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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 09:01:29 2024 UTC