|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-01-17 13:45 UTC] sander@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 04:00:02 2025 UTC |
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::))