php - error loop with while and foreach -
i should display table under
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
this code
$datequery = mysql_query("select matches.id, date_debut, date_fin, matches.score, sports.title sport, clubs1.title recevant, clubs2.title visiteur, competitions.title competition, matches.description, sexes.title sexe matches inner join sexes on sexes.id = matches.sexe_id inner join sports on sports.id = matches.sport_id inner join clubs clubs1 on clubs1.id = matches.recevant_id inner join clubs clubs2 on clubs2.id = matches.visiteur_id inner join competitions on competitions.id = matches.competition_id current_date()<=date_debut order 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 $sdate => $tindexeddate){ foreach($tindexeddate $sevenement => $tindexedevenement){ foreach($tindexedevenement $stexte){ $stexte = $row['recevant'].'-'.$row['visiteur']; print date("h:i",strtotime($row['date_debut'])).' | ' .$row['sport'].' | '.$row['competition'].' | '.$stexte.' <br />'; } } } }
the wrong result display
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
i hope can me resolve problem.
thanks you
try
$datequery = mysql_query("select distinct matches.id, date_debut, date_fin, matches.score, sports.title sport, clubs1.title recevant, clubs2.title visiteur, competitions.title competition, matches.description, sexes.title sexe matches inner join sexes on sexes.id = matches.sexe_id inner join sports on sports.id = matches.sport_id inner join clubs clubs1 on clubs1.id = matches.recevant_id inner join clubs clubs2 on clubs2.id = matches.visiteur_id inner join competitions on competitions.id = matches.competition_id current_date()<=date_debut order date_debut asc") or die(mysql_error());
Comments
Post a Comment