0
我想下错误循环
September 2013
- 14/09/2013 | 14:30 | Football | League | Paris - Berlin
- 14/09/2013 | 19:30 | Volley | Cup | Paris - Barcelona
- 25/09/2013 | 12:00 | Football | Amical | Paris - Bordeaux
October 2013
- 5/10/2013 | 15: 00 | Cup | Paris - Londres
这是我的代码
$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 '<b>'.$tIndexed[$row['date_debut'] ][ $row['sport'] ][]=date("d-m-Y",strtotime($row['date_debut'])).'</b><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 />'; } } } }
错误的结果显示
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
我希望你能帮助显示该表向我解决这个问题。
感谢您
那么,什么是你的问题? –
他希望显示的结果如他在问题开始时描述的 – Paddyd
将起始查询更改为SELECT distinct(matches.id) – nickle