J'ai fais un test avec ca :
Code PHP :
<?
$sql = "SELECT * FROM fq_perso WHERE login='".$_SESSION['login']."'";
$req = mysql_query($sql) or die(mysql_error());
$coordx = $req['coordx'];
$coordy = $req['coordy'];
while ($data = mysql_fetch_array($req)) {
echo 'Les coordonnées sont '.$data['coordx'].','.$data['coordy'].'.';
$sql2 = "SELECT * FROM fq_map WHERE coordx=$coordx AND coordy=$coordy";
$req2 = mysql_query($sql2) or die(mysql_error());
while ($data2 = mysql_fetch_array($req2)) {
echo '<img src="images/map/'.$data2['image'].'">';
}}
?>
et ca me donne donc :
Code :
Les coordonnées sont 2,2.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND coordy=' at line 1