J'ai un jolie petit code mais j'aimerai y apporter une amélioration pour qu'un tri par année se fasse ... je suppose que c'est dans la requête que je dois faire le tri ! ? !
<?php require_once('../Connections/kainbuye.php');
$colname_participant = "-1";
if (isset($_GET['part'])) {
$colname_participant = (get_magic_quotes_gpc()) ? $_GET['part'] : addslashes($_GET['part']);
}
mysql_select_db($database_kainbuye, $kainbuye);
$query_participant = sprintf("SELECT ID_coureur, nom, prenom FROM acrho_participant WHERE ID_coureur = %s", $colname_participant);
$participant = mysql_query($query_participant, $kainbuye) or die(mysql_error());
$row_participant = mysql_fetch_assoc($participant);
$totalRows_participant = mysql_num_rows($participant);
$colname_chang = -1;
if (isset($_GET['part']))
{
$colname_chang = (get_magic_quotes_gpc()) ? $_GET['part'] : addslashes($_GET['part']);
}
mysql_select_db($database_kainbuye, $kainbuye);
$query_chang = "SELECT t1.ID_coureur,
t1.nom,
t1.prenom,
t2.id_categorie,
t2.nom_categorie,
t3.id_club,
t3.nom_cub,
t4.acrho_club_id_club,
t4.acrho_participant_ID_participant,
t4.annee,
t4.dossard,
t4.acrho_categorie_ID_categorie ".
"FROM acrho_participant AS t1,
acrho_categorie AS t2,
acrho_club AS t3,
acrho_changement AS t4 ".
"ORDER BY t4.annee ASC".
"WHERE t1.ID_coureur = ".$colname_chang." ".
"AND t4.acrho_participant_ID_participant = t1.ID_coureur ".
"AND t4.acrho_categorie_ID_categorie = t2.id_categorie ".
"AND t4.acrho_club_id_club = t3.id_club";
$chang = mysql_query($query_chang, $kainbuye) or die(mysql_error());
$row_chang = mysql_fetch_assoc($chang);
$totalRows_chang = mysql_num_rows($chang);
?>
Comme vous pouvez le voir j'ai ajouter ceci
"ORDER BY t4.annee ASC".
Mais j'ai ce message d'erreurCode : Tout sélectionner
You have an error in your SQL syntax near 'ASCWHERE t1.ID_coureur = 900 AND t4.acrho_participant_ID_participant = t1.ID_cou' at line 15Merci