Bug #2372: use database for two different database cause all the link to point to only one

From: Date: Fri, 24 Sep 1999 07:46:06 +0000
Subject: Bug #2372: use database for two different database cause all the link to point to only one
Groups: php.dev 
Request: Send a blank email to php-dev+get-11264@lists.php.net to get a copy of this message
From: carmelo@melting-soft.com Operating system: suse 5 PHP version: 3.0.12 PHP Bug Type: MySQL related Bug description: use database for two different database cause all the link to point to only one Suppose you have : sql : Create database DB1; Create table A ( aid integer not null , ); Create database DB2; Create table B ( bid integer not null , ); php: <?php $link1=mysql_pconnect("", "root", ""); if (!$link1) { exit; } $link2=mysql_pconnect("", "root", ""); if (!$link2) { exit; } if (!@mysql_select_db("DB1",$link1)) { exit; } if (!@mysql_select_db("DB2",$link2)) { exit; } $queryid = @mysql_query("select * from B",$link2); echo "$link2, $queryid<br>"; echo "error :".mysql_error()."<br>"; $queryid = @mysql_query("select * from A",$link1); echo "$link1, $queryid<br>"; echo "error :".mysql_error()."<br>"; ?> result: 2, 3 error : 1, error :Table DB2.A' doesn't exist here it is, I think this should be enough one last thing, there was the same bug on php4, and so I made a test under php3 to be sure it was not a php4 specific bug.

« previous php.dev (#11264) next »