Re: PHP accessing MySQL
| From: | Darren | Date: | Fri, 18 May 2001 20:58:39 +0000 |
| Subject: | Re: PHP accessing MySQL | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-9453@lists.php.net to get a copy of this message | ||
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
>