Affectation de <?php echo $row_affect['prenom']; ?> <?php echo $row_affect['nom']; ?></td>
Ne faut-il pas mettre plutôt ceci?<?php echo $row_affect['acrho_participant.prenom']; ?> <?php echo $row_affect['acrho_participant.nom']; ?></td>
??????'acrho_participant.prenom' Code : Tout sélectionner
SELECT t1.champ AS premier_champ FROM ...echo($ligne['premier_champ']);
Essaye de modifier comme ça et si tu as un message d'erreur, affiche-le ici qu'on ait une première idée de la nature du problème.Et pour tant ! ! !You have an error in your SQL syntax near '-1 AS t1 WHERE t1.ID_coureur = 226' at line 1
<?php
$colname_affect = "-1";
if (isset($_GET['part'])) {
$colname_affect = (get_magic_quotes_gpc()) ? $_GET['part'] : addslashes($_GET['part']);
}
mysql_select_db($database_kainbuye, $kainbuye);
$query_affect = sprintf("SELECT t1.ID_coureur, t1.nom, t1.prenom FROM acrho_participant-1 AS t1 WHERE t1.ID_coureur = %s", $colname_affect);
$affect = mysql_query($query_affect, $kainbuye) or die(mysql_error());
$row_affect = mysql_fetch_assoc($affect);
$totalRows_affect = mysql_num_rows($affect);
?>
Y'a certainement encore un truc débile ... une poussière dans l'engrenage ! ? !Code : Tout sélectionner
...FROM acrho_participant-1 AS t1...Code : Tout sélectionner
...FROM `acrho_participant-1` AS t1...Table 'kainbuye.acrho_participant-1' doesn't exist
$_GET['chang']
quel est le lien qui passe cette variable ?pas sur que cette table existe "acrho_participant-1" !Je n'ai pourtant rien changé d'autreSELECT t1.ID_coureur, t1.nom, t1.prenom FROM `acrho_participant-1` AS t1 WHERE t1.ID_coureur = %s
C'est quoi "kainbuye"Table 'kainbuye.acrho_participant-1' doesn't exist
mysql_select_db($database_kainbuye, $kainbuye);
$query_chang = sprintf("SELECT t1.id_categorie, t1.nom_categorie, t2.id_club, t2.nom_cub, t3.ID_coureur, t3.nom, t3.prenom, t4.acrho_club_id_club, t4.acrho_participant_ID_participant, t4.annee, t4.dossard, t4.acrho_categorie_ID_categorie FROM acrho_categorie AS t1, acrho_club AS t2, acrho_participant AS t3, acrho_changement AS t4 WHERE t4.acrho_club_id_club = t2.id_club AND t4.acrho_participant_ID_participant = t3.ID_coureur AND t4.acrho_categorie_ID_categorie = t1.id_categorie", $colname_chang);
avec un fonction de formatage sprintf() avec une variable ($colname_chang) à inserer mais où ? il manque un format "%s" ou "%d" (par exemple) selon le type de $colname_chang.echo $query_chang;
puis cpoier/coller dans phpmyadmin<?php require_once('../Connections/kainbuye.php'); ?>
<?php
mysql_select_db($database_kainbuye, $kainbuye);
$query_participant = "SELECT * FROM acrho_participant ORDER BY nom ASC";
$participant = mysql_query($query_participant, $kainbuye) or die(mysql_error());
$row_participant = mysql_fetch_assoc($participant);
$totalRows_participant = mysql_num_rows($participant);
function makeStamp($theString) {
if (ereg("([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})", $theString, $strReg)) {
$theStamp = mktime($strReg[4],$strReg[5],$strReg[6],$strReg[2],$strReg[3],$strReg[1]);
} else if (ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})", $theString, $strReg)) {
$theStamp = mktime(0,0,0,$strReg[2],$strReg[3],$strReg[1]);
} else if (ereg("([0-9]{2}):([0-9]{2}):([0-9]{2})", $theString, $strReg)) {
$theStamp = mktime($strReg[1],$strReg[2],$strReg[3],0,0,0);
}
return $theStamp;
}
function makeDateTime($theString, $theFormat) {
$theDate=date($theFormat, makeStamp($theString));
return $theDate;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>liste de participants</title>
<link href="../cosmic18.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="526" border="0" cellpadding="0" cellspacing="0" class="cosmic18">
<!--DWLayoutTable-->
<tr>
<td width="15" height="51"> </td>
<td width="511"> </td>
</tr>
<tr>
<td height="34"> </td>
<td valign="top"><table width="500" border="1" cellspacing="0" cellpadding="0">
<!--DWLayoutTable-->
<tr>
<td width="75"><div align="center"><strong>Nbre inscrit</strong></div></td>
<td width="100"><div align="center"><strong>Nom</strong></div></td>
<td width="100"><div align="center"><strong>Prénom</strong></div></td>
<td width="100"><div align="center"><strong>Né le </strong></div></td>
<td width="75"><div align="center"><strong>Sexe</strong></div></td>
<td width="75"><!--DWLayoutEmptyCell--> </td>
</tr>
<?php
$compteur = 1;
do
{
?>
<?php do { ?>
<tr>
<td width="75" align="center"><?php echo $compteur; ?></td>
<td width="100"><?php echo $row_participant['nom']; ?></td>
<td width="100"><?php echo $row_participant['prenom']; ?></td>
<td width="100"><div align="right"><?php echo makeDateTime($row_participant['date_naissance'], 'd-m-Y'); ?></div></td>
<td width="75"><div align="center"><?php echo $row_participant['sexe']; ?></div></td>
<td width="75"><div align="center"><strong><a href="affect2.php?part=<?php echo $row_participant['ID_coureur']; ?>">Affectation</a></strong></div></td>
</tr>
<?php } while ($row_participant = mysql_fetch_assoc($participant)); ?>
<?php
$compteur++;
}
while ($row_participant = mysql_fetch_assoc($participant)); ?>
</table></td>
</tr>
<tr>
<td height="229"> </td>
<td> </td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($participant);
?>
Voici la page pour l'insertion! J'aimerai y mettre toutes les tables mais déjà un problème de lecture pour une <?php require_once('../Connections/kainbuye.php'); ?>
<?php
$colname_affect = "-1";
if (isset($_GET['part'])) {
$colname_affect = (get_magic_quotes_gpc()) ? $_GET['part'] : addslashes($_GET['part']);
}
mysql_select_db($database_kainbuye, $kainbuye);
$query_affect = sprintf("SELECT t1.ID_coureur, t1.nom, t1.prenom FROM acrho_participant-1 AS t1 WHERE t1.ID_coureur = %s", $colname_affect);
$affect = mysql_query($query_affect, $kainbuye) or die(mysql_error());
$row_affect = mysql_fetch_assoc($affect);
$totalRows_affect = mysql_num_rows($affect);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Document sans titre</title>
<link href="../cosmic18.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="540" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="540" height="19"></td>
</tr>
<tr>
<td height="30" align="center" valign="top">Affectation de <?php echo $row_affect['t1.nom']; ?> <?php echo $row_affect['t1.prenom']; ?></td>
</tr>
<tr>
<td height="16"></td>
</tr>
<tr>
<td height="34" valign="top"><table width="100%" border="1" cellpadding="0" cellspacing="0" class="cosmic18">
<tr>
<td><div align="center"><strong>Année</strong></div></td>
<td><div align="center"><strong>Dossard</strong></div></td>
<td><div align="center"><strong>Catégorie</strong></div></td>
<td><div align="center"><strong>Club</strong></div></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table></td>
</tr>
<tr>
<td height="44"> </td>
</tr>
<tr>
<td height="22" valign="top" class="cosmic18"><div align="right"><a href="part_affect.php">Retourner aux participants [Affectation]</a> </div></td>
</tr>
<tr>
<td height="29"> </td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($affect);
?>
L'adresse de la page '222' pour l'instant http://60gp.ovh.net/~kainbuye/index.php ... &Itemid=43. Je ne serais pas là aujourd'hui donc je tarderais certainement dans mes futurs réponses
$colname_affect = "-1";
if (isset($_GET['part'])) {
$colname_affect = (get_magic_quotes_gpc()) ? $_GET['part'] : addslashes($_GET['part']);
}
Si je l'enlève rien ne se passe ... la page ne fait pas le lien!`acrho_participant`-1
et bien un message d'erreur
Merci pour le coup de mainYou have an error in your SQL syntax near '-1 AS t1 WHERE t1.ID_coureur = 60' at line 1