Problème affichage avec tri
Bonjour
Je me permets de vous ecrire ce post car j'ai un petit soucis dans ma requête sql. Je souhaite afficher des évènements par date (du plus récent au plus ancien) et de les regrouper par ville
par exemple
Evenement 1 à Angers
Evenement 2 à Angers
Evenement 3 à Nantes
Evenement 4 à Paris
pour le moment je tri que sur la date
voici mon code
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
public function eventSelectAll () {
/* Récupération des party autorisées. ----------------------------------------------------------*/
$tmpParty=$this->eventSelectAuthorized ();
$this->requete='SELECT * FROM ' . TABLE_EVENT . ' WHERE \'1\'';
$this->requete.=' AND ' . EVENT_ID . ' IN (';
for ($cc=0; $cc<count ($tmpParty); $cc++)
$this->requete.=$tmpParty[$cc] . ', ';
$this->requete=substr ($this->requete, 0, -2) . ') ORDER BY ' . EVENT_DATE . ' DESC';
unset ($tmpParty);
mysqlUK::execRequete ();
while ($liste=mysql_fetch_array ($this->resultats)) {
$this->partyEvent[]=array (
EVENT_ID => $liste[EVENT_ID],
EVENT_DATE => $liste[EVENT_DATE],
EVENT_DATESTART => $liste[EVENT_DATESTART],
EVENT_DATESTOP => $liste[EVENT_DATESTOP],
EVENT_NOM => stripslashes ($liste[EVENT_NOM]),
EVENT_NBMEMBRES => $liste[EVENT_NBMEMBRES],
EVENT_STATUT => $liste[EVENT_STATUT],
EVENT_ORGANISATEUR => $liste[EVENT_ORGANISATEUR],
EVENT_LOCALISATION => $liste[EVENT_LOCALISATION]
);
}
for ($cc=0; $cc<count ($this->partyEvent); $cc++) {
if ($this->partyEvent[$cc][EVENT_ORGANISATEUR]) {
$this->organisateurSelectOne ($this->partyEvent[$cc][EVENT_ORGANISATEUR]);
$this->partyEvent[$cc][EVENT_ORGANISATEUR]=$this->organisateur;
unset ($this->organisateur);
} else {
$this->partyEvent[$cc][EVENT_ORGANISATEUR]=array (
MEMBRE_PRENOM => ' ',
MEMBRE_NOM => ' '
);
}
if ($this->partyEvent[$cc][EVENT_LOCALISATION]) {
$this->localisationSelectOne ($this->partyEvent[$cc][EVENT_LOCALISATION]);
$this->partyEvent[$cc][EVENT_LOCALISATION]=$this->localisation;
unset ($this->localisation);
} else {
$this->partyEvent[$cc][EVENT_LOCALISATION]=array (
EVENTLOCALISATION_TITRE => ' '
);
}
}
} |
Je vous remercie de votre aide