From: [EMAIL PROTECTED] Operating system: Linux Redhat 7.1 PHP version: 4.0.5 PHP Bug Type: MySQL related Bug description: mysql_query for insert statement does not work proprely
I have wrote the script bellow : for ($i=50;$i<60;$i++) { $requette="INSERT INTO DRE(cle_DRE,nom) VALUES(".$i.",'DRE".$i."')"; $resultat=mysql_query($requette,$connexion); if ($resultat==FALSE) {echo "Erreur : ".mysql_error()."<br>"; return -1;} } the field "cle_DRE" is the primary key of the table "DRE". in the beggining, the table is empty, and when trying to execute this script, the behavior is random, sometimmes it works proprely, and the rows are added to the table, other times, it generates an error message : Erreur : Duplicate entry '50' for key 1. before lunching the script, i always initialise the table (i make it empty). thanks for help::)) -- Edit bug report at: http://bugs.php.net/?id=15085&edit=1 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]