Re: PHP accessing MySQL

From: Date: Tue, 22 May 2001 18:58:47 +0000
Subject: Re: PHP accessing MySQL
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-9535@lists.php.net to get a copy of this message
That is what I thought, so I set $db_num to another number and still came up with the same error. jkd ""Darren"" <darrenls21@yahoo.com> wrote in message news:9e42lj$s7b$1@toye.p.sourceforge.net... > I think the 0 is referring to your $db_num > "Jonathan Duncan" <jonathan@nacnud.com> wrote in message > news:9e3suq$17r$1@toye.p.sourceforge.net... > > 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 > > > > > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > > For additional commands, e-mail: php-db-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#9535) next »