PHP accessing MySQL

From: Date: Fri, 18 May 2001 19:33:07 +0000
Subject: PHP accessing MySQL
Groups: php.db 
Request: Send a blank email to php-db+get-9450@lists.php.net to get a copy of this message
I am making a script to access MySQL and when I run it I get this: Warning: 0 is not a MySQL link index in /sites/htdocs/php/db_listtables.php on line 10 Following is the first 10 lines of my script: <? $connection = mysql_connect("localhost", "user", "password") or die("Couldn't connect."); $dbs = mysql_list_dbs($connection) or die("Couldn't list databases."); $db_list = "<UL>"; $db_num = 0; while ($db_num < mysql_num_rows($dbs)) { $db_names[$db_num] = mysql_tablename($dbs, $db_num); $db_list .= "<LI>$db_names[$db_num]"; if (($db_names[$db_num] != "mysql") && ($db_names[$db_num] != "tempdata")) { $tables = mysql_list_dbs($db_names[$db_num]) or die("Couldn't list databases."); Any Ideas? Thank you in advance!! Jonathan

« previous php.db (#9450) next »