Bug #51602 [Opn->Csd]: mysql link looses database selection with multiple links

From: Date: Mon, 19 Apr 2010 16:00:44 +0000
Subject: Bug #51602 [Opn->Csd]: mysql link looses database selection with multiple links
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-149699@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=51602&edit=1

 ID:               51602
 User updated by:  courtois at nouvo dot com
 Reported by:      courtois at nouvo dot com
 Summary:          mysql link looses database selection with multiple
                   links
-Status:           Open
+Status:           Closed
 Type:             Bug
 Package:          MySQL related
 Operating System: debian lenny
 PHP Version:      5.2.13

 New Comment:

checking some parameters with other users...


Previous Comments:
------------------------------------------------------------------------
[2010-04-19 17:10:25] courtois at nouvo dot com

Description:
------------
when using 2 databases at the same time with 2 links, database selection
is lost.

Test script:
---------------
<?php

  $db1 = mysql_connect("localhost","user1","pass");
  mysql_select_db("database1",$db1);

  $db2 = mysql_connect("localhost","user2","pass");
  mysql_select_db("database2",$db2);


  if(!(mysql_query("select * from mytable",$db1)))
       print "error:".mysql_error();
     else
       print "ok";
?>

Expected result:
----------------
should print "ok" 
works fine with windows (builtin mysql) but not with debian lenny

Actual result:
--------------
error:Table 'database2.mytable' doesn't exist

the select is done on database2 although database1 was selected on the
$db1 link.



------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51602&edit=1


Thread (2 messages)

« previous php.bugs (#149699) next »