|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-04-08 09:16 UTC] klaus dot kuehne at gga-hannover dot de
Description:
------------
Depending of database and/or network charge, a single INSERT may be executed more than one time by mssql_query(), even if the first INSERT was executed successfully. The return code of mssql_query will be set to the last executed INSERT.
In my case, a unique index prevented the subsequent INSERT's. This caused a lot of confusion, because the first INSERT was completed successful and mssql_query("INSERT INTO ...", $con) delivered "false" nevertheless.
Problably, a longer delay time will be misinterpreted as a database lock, and mssql_query tries to encounter this by repetitions of the same INSERT.
Couldn't find any workaround for this.
I recognized this bug in PHP versions 4.3.2 - 4.3.5.
Expected result:
----------------
A succesful INSERT may not be repeated.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 02:00:01 2025 UTC |
Yes, this bug exist in PHP 5.0.4 also yesterday I detect bug. this bug very strange. $res = mysql_query("insert into page_sql (name) values('ZANUSSI')") or die("Query failed : " . mysql_error()); $id = mysql_insert_id(); insert one time; execute then any "select" "insert" again executed; sorry for my English Orlov Oleg.