#27920 [Bgs]: Mutliple execution of SQL-INSERT by mssql_query

From: Date: Mon, 06 Jun 2005 11:41:31 +0000
Subject: #27920 [Bgs]: Mutliple execution of SQL-INSERT by mssql_query
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-79953@lists.php.net to get a copy of this message
ID: 27920 User updated by: klaus dot kuehne at gga-hannover dot de Reported By: klaus dot kuehne at gga-hannover dot de Status: Bogus Bug Type: MSSQL related Operating System: Win 2000 Server PHP Version: 4.3.5 New Comment: To express this clearer: Instead of: <input type="submit" onclick="document.forms[0].action='insert.php'; document.forms[0].submit();"> (this causes a double sumbmit) you should write: <input type="button" onclick="document.forms[0].action='insert.php'; document.forms[0].submit();"> Regards, Klaus Previous Comments: ------------------------------------------------------------------------ [2005-06-06 09:34:55] derick@php.net Bogus then. ------------------------------------------------------------------------ [2005-06-06 09:27:06] klaus dot kuehne at gga-hannover dot de Hello Oleg, in my case, this was a bug of myself (and of many other PHP developers, too). The INSERT script was triggered by a FORM submit (&ltform action=insert.php>. Erroneously, I started the script a seond time by: &lt;input type="submit" onclick="document.forms[0].action='insert.php'; document.forms[0].submit();"> And so the same INSERT was performed two times. The output of the second call overwrote the output of the first call, and my control prints of the frist call disappeared. Very malicious, this effect. You should proof your script for a double submit. Regards, Klaus Kühne ------------------------------------------------------------------------ [2005-06-06 04:42:39] orlov_oleg at hotmail dot ru 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. ------------------------------------------------------------------------ [2004-04-12 17:54:07] sniper@php.net No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you. ------------------------------------------------------------------------ [2004-04-08 16:01:59] fmk@php.net mssql_query() does not do anything to the SQL statement, other than passing it on to the SQL server (once). There is no code to resubmit the same statement. The SQL statement can be a batch of inserts and or other commands, and mssql_query() will return false if one statement fails to execute on the server. A true value is returned if everything was executed with success but no data sets were returned (INSERT, UPDATE and DELETE statements). If a single statement returns a recordset mssql_query() will return a reource handle for the data. I think this is a bug in either your PHP code or in the SQL statements (batches) you are sending to the server. Can you please provide some more info woth some code that reproduces the error. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/27920 -- Edit this bug report at http://bugs.php.net/?id=27920&edit=1

« previous php.bugs (#79953) next »