par
Merme » 14 juil. 2010, 13:01
Bonjour @ tous,
Voila je tourne en rond depuis quelques temps sur mon problème.
Je fais un select sur 2 tables et je renvoie le tout dans un array.
Quand j'exécute ma query sous phpmyadmin je retrouve bien le bon résultat, donc la query en elle même est juste.
Par contre quand je veux afficher le résultat je n'ai aucun retour.
Voici le code.
$select = "SELECT
participants_10km.nom,
participants_10km.prenom,
participants_10km.dossard,
`paiements`.nom,
`paiements`.prenom,
`paiements`.cheque,
`paiements`.liquide,
`paiements`.trans_id
FROM
participants_10km,
`paiements`
GROUP BY
participants_10km.nom,
participants_10km.prenom,
participants_10km.dossard,
participants_10km.paiement,
`paiements`.nom,
`paiements`.prenom
HAVING
`paiements`.nom = participants_10km.nom AND
`paiements`.prenom = participants_10km.prenom AND
`paiements`.cheque = 0 AND
`paiements`.liquide = 0
AND `paiements`.trans_id = ''";
$result = mysql_query($select) or die ('Erreur : '.mysql_error() );
echo"
<div id='cssnom'> <b>DOSSARD</b> <b>NOM</b> <b>PRENOM</b></div>
";
while($donnes = mysql_fetch_array($result))
{
echo"
<div id='cssprenom'> $donnees[dossard] $donnees[nom] $donnees[prenom] </div>
";
}
Merci par avance pour votre aide !!!
Bonjour @ tous,
Voila je tourne en rond depuis quelques temps sur mon problème.
Je fais un select sur 2 tables et je renvoie le tout dans un array.
Quand j'exécute ma query sous phpmyadmin je retrouve bien le bon résultat, donc la query en elle même est juste.
Par contre quand je veux afficher le résultat je n'ai aucun retour.
Voici le code.
[sql]$select = "SELECT
participants_10km.nom,
participants_10km.prenom,
participants_10km.dossard,
`paiements`.nom,
`paiements`.prenom,
`paiements`.cheque,
`paiements`.liquide,
`paiements`.trans_id
FROM
participants_10km,
`paiements`
GROUP BY
participants_10km.nom,
participants_10km.prenom,
participants_10km.dossard,
participants_10km.paiement,
`paiements`.nom,
`paiements`.prenom
HAVING
`paiements`.nom = participants_10km.nom AND
`paiements`.prenom = participants_10km.prenom AND
`paiements`.cheque = 0 AND
`paiements`.liquide = 0
AND `paiements`.trans_id = ''";[/sql]
[php]$result = mysql_query($select) or die ('Erreur : '.mysql_error() );
echo"
<div id='cssnom'> <b>DOSSARD</b> <b>NOM</b> <b>PRENOM</b></div>
";
while($donnes = mysql_fetch_array($result))
{
echo"
<div id='cssprenom'> $donnees[dossard] $donnees[nom] $donnees[prenom] </div>
";
}[/php]
Merci par avance pour votre aide !!!