|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-09-03 06:30 UTC] d dot durieux at siprossii dot com
[2008-09-03 07:07 UTC] tularis@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 08 07:00:01 2025 UTC |
Description: ------------ There is a problem when I select a line in mysql table and afet I delete it. Reproduce code: --------------- It works : $sql = 'SELECT * FROM sous_domaine WHERE id="10" '; $req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error()); while($data = mysql_fetch_assoc($req)) { echo $data['id']; } $sql2 = 'DELETE FROM sous_domaine WHERE id="10" '; $req2 = mysql_query($sql2) or die('Erreur SQL !<br>'.$sql2.'<br>'.mysql_error()); It don't work : $sql = 'SELECT * FROM sous_domaine WHERE id="'.$_GET['id'].'" '; $req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error()); while($data = mysql_fetch_assoc($req)) { echo $data['id']; } $sql2 = 'DELETE FROM sous_domaine WHERE id="'.$_GET['id'].'" '; $req2 = mysql_query($sql2) or die('Erreur SQL !<br>'.$sql2.'<br>'.mysql_error()); Expected result: ---------------- In first case (it works) : I see the id get in mysql and it delete it after In second case (it don't work) : I don't see id get in mysql. It's like if it delete it first and after select. I have not error in php log.