From:             lucifer at vengeance dot et dot tudelft dot nl
Operating system: PHP: WinXP MySQL: Win2k
PHP version:      4.2.3
PHP Bug Type:     MySQL related
Bug description:  mysql_list_tables selects database

the function "mysql_list_tables" changes the database subsequent queries
will run on; an example:

$link = mysql_connect( "host", "user", "password" );
mysql_select_db( "db1", $link );

/* now db1 is selected */
print "** tables in selected database before mysql_list_tables **<BR>"
$q = mysql_query( "show tables" );
while( $row = mysql_fetch_array( $q ) ) {
  print $row[0]."<BR>";
}

$tables = mysql_list_tables( "db2" );

/* now db2 is selected */
print "** tables in selected database after mysql_list_tables **<BR>"
$q = mysql_query( "show tables" );
while( $row = mysql_fetch_array( $q ) ) {
  print $row[0]."<BR>";
}

-- 
Edit bug report at http://bugs.php.net/?id=22661&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22661&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22661&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22661&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22661&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22661&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22661&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22661&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22661&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22661&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22661&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22661&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22661&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22661&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22661&r=gnused

Reply via email to