#30137 [Com]: php losts one of two mysql links

From: Date: Fri, 16 Dec 2005 09:50:39 +0000
Subject: #30137 [Com]: php losts one of two mysql links
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-90526@lists.php.net to get a copy of this message
ID: 30137 Comment by: andreas at fink dot org Reported By: sh4dow at php dot pl Status: No Feedback Bug Type: MySQL related Operating System: Win2000 PHP Version: 5.0.1 New Comment: Seen this exact behaviour in 5.0.4 $db1 = mysql_pconnect($db_server,$db_user,$db_pass); mysql_select_db('db1_msg',$db1) or die( "Unable to select database1"); $db2 = mysql_pconnect($db_server,$db_user,$db_pass); mysql_select_db('db2',$db2) or die( "Unable to select database2"); ... $res = mysql_query($sql,$db1); the query is not done on database "db1" as expected but on "db2" This problem is existing in 5.1.1 too Previous Comments: ------------------------------------------------------------------------ [2004-11-14 01:00:06] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". ------------------------------------------------------------------------ [2004-11-06 07:04:03] edink@php.net Please try using this CVS snapshot: http://snaps.php.net/php5-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.0-win32-latest.zip ------------------------------------------------------------------------ [2004-09-17 19:55:36] sh4dow at php dot pl Description: ------------ when i try to make 2 difrent connection to the mysql, php lost one of them, and all query are making by only one connection. Where is the second ? Reproduce code: --------------- $link1 = mysql_connect('localhost', 'user1', '***') or die(mysql_error()); mysql_select_db('baza1', $link1) or die(mysql_error()); $link2 = mysql_connect('localhost', 'user2', '***') or die(mysql_error()); mysql_select_db('baza2', $link2) or die(mysql_error()); $query1 = mysql_query("SELECT * from users LIMIT 0,1", $link1); while ($r1 = mysql_fetch_assoc($query1)){ var_dump($r1); } $query2 = mysql_query("SELECT * from users LIMIT 0,1", $link2); while ($r2 = mysql_fetch_assoc($query2)){ var_dump($r2); } Expected result: ---------------- should be two difrent results Actual result: -------------- only one result, the second give an error or null ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30137&edit=1

« previous php.bugs (#90526) next »