01-12-2008, 12:15 AM
Evidement, il y a 1 lézard :nonon:
Le second insert ne fonctionne pas il m'affiche "query was empty"
Le second insert ne fonctionne pas il m'affiche "query was empty"
Code :
$requete = mysql_query("SELECT posx, posy FROM membres WHERE id = $id;");
$rsa= mysql_fetch_assoc ($requete);
$posx = $rsa['posx'];
$posy = $rsa['posy'];
$sql = "INSERT INTO ville (id, nom, image, type, population, posx, posy, date_creation) VALUES ('','". mysql_real_escape_string($ville) ."', './relief/ville.gif', 'ville', '1', $posx, $posy, NOW())";
mysql_query($sql) or die('Erreur SQL '.$sql.'<br>'.mysql_error());
$sq2= mysql_query("SELECT image FROM map WHERE posx= $posx AND posy= $posy; ");
$rsb= mysql_fetch_assoc ($sq2);
$image= $rsb['image'];
$maj= "INSERT INTO mapville (id, nom, posx, posy, image, ville_id ) VALUES ('', '". mysql_real_escape_string($ville) ."', 0, 0, '".$image."', '' )";
mysql_query($smaj) or die('Erreur SQL '.$maj.'<br>'.mysql_error());