php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51602 mysql link looses database selection with multiple links
Submitted: 2010-04-19 17:10 UTC Modified: 2010-04-19 18:00 UTC
From: courtois at nouvo dot com Assigned:
Status: Closed Package: MySQL related
PHP Version: 5.2.13 OS: debian lenny
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: courtois at nouvo dot com
New email:
PHP Version: OS:

 

 [2010-04-19 17:10 UTC] 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.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-19 18:00 UTC] courtois at nouvo dot com
-Status: Open +Status: Closed
 [2010-04-19 18:00 UTC] courtois at nouvo dot com
checking some parameters with other users...
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 11:01:36 2025 UTC