#22661 [Opn->Csd]: mysql_list_tables selects database
| From: | georg@php.net | Date: | Thu, 13 Mar 2003 08:47:54 +0000 |
| Subject: | #22661 [Opn->Csd]: mysql_list_tables selects database | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969352197@lists.php.net to get a copy of this message | ||
ID: 22661
Updated by: georg@php.net
Reported By: lucifer at vengeance dot et dot tudelft dot nl
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: PHP: WinXP MySQL: Win2k
PHP Version: 4.2.3
New Comment:
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2003-03-12 11:12:53] georg@php.net
Function should be marked as deprecated (like some others which have a
sql command eviqualent)
You should use SHOW TABLES FROM DATABASE instead.
------------------------------------------------------------------------
[2003-03-12 10:46:51] lucifer at vengeance dot et dot tudelft dot nl
sorry for the parsing errors in the example; i saw them too late :)
------------------------------------------------------------------------
[2003-03-12 10:45:33] lucifer at vengeance dot et dot tudelft dot nl
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 this bug report at http://bugs.php.net/?id=22661&edit=1