php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15085 mysql_query for insert statement does not work proprely
Submitted: 2002-01-17 10:50 UTC Modified: 2002-01-18 08:02 UTC
From: a dot chine at criltechnology dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 4.0.5 OS: Linux Redhat 7.1
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: a dot chine at criltechnology dot com
New email:
PHP Version: OS:

 

 [2002-01-17 10:50 UTC] a dot chine at criltechnology dot 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::))

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-17 13:45 UTC] sander@php.net
Ask support questions on the appropriate mailinglist.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 16:01:30 2025 UTC