php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53239 Duplicate Calling of MySQL Query after EXIT
Submitted: 2010-11-03 23:03 UTC Modified: 2010-11-04 18:07 UTC
From: michaelmunsie at yahoo dot com Assigned:
Status: Closed Package: MySQL related
PHP Version: 5.3SVN-2010-11-03 (SVN) OS: Ubuntu 10.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
22 - 5 = ?
Subscribe to this entry?

 
 [2010-11-03 23:03 UTC] michaelmunsie at yahoo dot com
Description:
------------
Using mysql_query and typing "exit" after the call is resulting in duplicate queries. If you take "exit" off the end of the code, the query will be executed only once as it should. 

$host = "localhost";
$user = "root";
$password = "password";
$databasename = "databasename";
$connection=mysql_connect ($host, $user, $password) or die ('I cannot  connect to the database because: ' . mysql_error()); 
mysql_select_db($databasename);	
	
$sql = "INSERT INTO table(field, field2, field3) VALUES('value1', 'value2', 'value3')";
$result = mysql_query($sql,$connection) or die ('Database error: ' . mysql_error());	
exit; // take this off and the call is executed once

Test script:
---------------
$host = "localhost";
$user = "root";
$password = "password";
$databasename = "databasename";
$connection=mysql_connect ($host, $user, $password) or die ('I cannot  connect to the database because: ' . mysql_error()); 
mysql_select_db($databasename);	
	
$sql = "INSERT INTO table(field, field2, field3) VALUES('value1', 'value2', 'value3')";
$result = mysql_query($sql,$connection) or die ('Database error: ' . mysql_error());	
exit; // take this off and the call is executed once


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-04 18:07 UTC] michaelmunsie at yahoo dot com
-Status: Open +Status: Closed
 [2010-11-04 18:07 UTC] michaelmunsie at yahoo dot com
This bug has been fixed. Simply do not use Yslow 2.1.0 on Linux Ubuntu 10.0.4 in Firefox with Autorun enabled. This will make requests twice for some strange reason.

Peace of mind at last :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 13:01:32 2024 UTC