Tri php
Fermé
tridam23
Messages postés
99
Date d'inscription
mercredi 5 novembre 2014
Statut
Membre
Dernière intervention
11 juin 2021
-
1 avril 2015 à 01:44
tridam23 Messages postés 99 Date d'inscription mercredi 5 novembre 2014 Statut Membre Dernière intervention 11 juin 2021 - 31 août 2015 à 01:38
tridam23 Messages postés 99 Date d'inscription mercredi 5 novembre 2014 Statut Membre Dernière intervention 11 juin 2021 - 31 août 2015 à 01:38
A voir également:
- Tri php
- Tri excel - Guide
- Easy php - Télécharger - Divers Web & Internet
- Logiciel de tri de photos - Guide
- Tri automatique excel sans macro ✓ - Forum Excel
- Colis rejeté par le centre de tri aliexpress - Forum Consommation & Internet
2 réponses
Utilisateur anonyme
1 avril 2015 à 06:46
1 avril 2015 à 06:46
je dirais simplement que dans ta requête tu ajoute ORDER BY $colonne $order
il suffit ensuite de simplement passer le bouton cliqué dans ton GET.
au passage, cela nécessitera de recharger la page a chaque clic. du javascript avec appels ajax, si tu sais faire, c'est mieux.
et pour finir ton php n'est pas en modèle MVC, mais a la limite ça c'est pas trop grave
$order = isset($_GET[''])?$_GET['colonne']:'CLASSE';
$req = "select * from ELEVES
ORDER BY $colonne $order ";
il suffit ensuite de simplement passer le bouton cliqué dans ton GET.
au passage, cela nécessitera de recharger la page a chaque clic. du javascript avec appels ajax, si tu sais faire, c'est mieux.
et pour finir ton php n'est pas en modèle MVC, mais a la limite ça c'est pas trop grave
ElementW
Messages postés
4816
Date d'inscription
dimanche 12 juin 2011
Statut
Contributeur
Dernière intervention
5 octobre 2021
1 228
Modifié par gravgun le 1/04/2015 à 18:40
Modifié par gravgun le 1/04/2015 à 18:40
'lut, avertissement très important:
L'extension MySQL (fonctions mysql_*) est obsolète et il ne faut absolument plus s'en servir!
Change pour PDO ou MySQLi maintenant, pendant que tu es en train d'apprendre et que ton code est petit!
Ici, ton
from human import idiocy
del idiocy
L'extension MySQL (fonctions mysql_*) est obsolète et il ne faut absolument plus s'en servir!
Change pour PDO ou MySQLi maintenant, pendant que tu es en train d'apprendre et que ton code est petit!
Ici, ton
or die(mysql_error());est une des gestion d'erreur parmi les plus horribles qui soient.
from human import idiocy
del idiocy
Modifié par gravgun le 1/04/2015 à 18:40
De plus pour un petit code c'est totalement overkill.
31 août 2015 à 01:38
je reviens vers vous now !