merci imikado
d'après ton code, j'ai un peu bidouillé rapidement pour voir ce que cela donne
$dateQuery = mysql_query("SELECT matches.id, date_debut, date_fin, matches.score, sports.title AS sport, clubs1.title AS recevant, clubs2.title AS visiteur, competitions.title AS competition, matches.description, sexes.title AS sexe
FROM matches
INNER JOIN sexes ON sexes.id = matches.sexe_id
INNER JOIN sports ON sports.id = matches.sport_id
INNER JOIN clubs AS clubs1 ON clubs1.id = matches.recevant_id
INNER JOIN clubs AS clubs2 ON clubs2.id = matches.visiteur_id
INNER JOIN competitions ON competitions.id = matches.competition_id
WHERE CURRENT_DATE()<=date_debut
ORDER BY date_debut ASC") or die(mysql_error());
while($row=mysql_fetch_assoc($dateQuery)){
print $tIndexed[$row['date_debut'] ][ $row['sport'] ][]=date("d-m-Y",strtotime($row['date_debut'])).'<br />';
foreach($tIndexed as $sDate => $tIndexedDate){
foreach($tIndexedDate as $sEvenement => $tIndexedEvenement){
foreach($tIndexedEvenement as $sTexte){
$sTexte = $row['recevant'].'-'.$row['visiteur'];
print date("H:i",strtotime($row['date_debut'])).' | ' .$row['sport'].' | '.$row['competition'].' | '.$sTexte.' <br />';
}
}
}
}
résultat:
il génère des doublons à chaque ligne donc ce n'est pas bon ....
14-09-2013
14:30 | Football | Championnat de France | IOS ORLEANS-CSSM PARIS
14-09-2013
19:30 | Football | Championnat de France | CSSM PARIS-ASLS NANCY
19:30 | Football | Championnat de France | CSSM PARIS-ASLS NANCY
21-09-2013
15:00 | Football | Championnat de France | CSS RENNES-CSSM PARIS
15:00 | Football | Championnat de France | CSS RENNES-CSSM PARIS
15:00 | Football | Championnat de France | CSS RENNES-CSSM PARIS
28-09-2013
19:30 | Football | Championnat de France | CSSM PARIS-CSS RENNES
19:30 | Football | Championnat de France | CSSM PARIS-CSS RENNES
19:30 | Football | Championnat de France | CSSM PARIS-CSS RENNES
19:30 | Football | Championnat de France | CSSM PARIS-CSS RENNES