Bug #15085 Updated: mysql_query for insert statement does not work proprely
| From: | sander@php.net | Date: | Thu, 17 Jan 2002 18:45:25 +0000 |
| Subject: | Bug #15085 Updated: mysql_query for insert statement does not work proprely | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-77358@lists.php.net to get a copy of this message | ||
ID: 15085
Updated by: sander
Reported By: a.chine@criltechnology.com
Old Status: Open
Status: Bogus
Bug Type: MySQL related
Operating System: Linux Redhat 7.1
PHP Version: 4.0.5
New Comment:
Ask support questions on the appropriate mailinglist.
Previous Comments:
------------------------------------------------------------------------
[2002-01-17 10:50:16] a.chine@criltechnology.com
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 this bug report at http://bugs.php.net/?id=15085&edit=1