Re: PHP accessing MySQL
| From: | Jonathan Duncan | Date: | Thu, 31 May 2001 21:05:42 +0000 |
| Subject: | Re: PHP accessing MySQL | ||
| References: | 1 2 3 4 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-14602@lists.php.net to get a copy of this message | ||
OK, I have found some more time to work on my PHP project. The problem is
indicated in the following line:
$tables = mysql_list_tables($db_names[$db_num]) or die("Couldn't list
databases.");
I took the variable $db_num and replaced it with a value of 1 as follows:
$tables = mysql_list_tables($db_names[1]) or die("Couldn't list
databases.");
The output gave me the following results:
The value of db_list is:
mysql
test
twignud
The value of dbs is: Resource id #2
The value of db_num is: 3
If I replace $db_num with a value of 0, 2 or 3 I get "Couldn't list
databases."
Any ideas anyone? Julie? Miles? Could this have anything to do with mysql
user permission?
Thanks,
jkd
""Jonathan Duncan"" <jonathan@nacnud.com> wrote in message
news:9eekpb$s41$1@toye.p.sourceforge.net...
> YES!! I just had a feeling the book was wrong. That did get rid of the
> error. However, it did not completely solve my issue. Now when I run the
> script I just get the message "Couldn't list databases." This just
happens
> to be the die message for the same line of code that I have been looking
at:
>
> $tables = mysql_list_tables($db_names[$db_num]) or die("Couldn't list
> databases.");
>
> It is almost as if it is not being able to even list the tables from the
> databases. I am working right now on just listing the tables of a
database
> to see what happens.
>
> Thank you,
> jkd
>
>
> "Julie Meloni" <julie@thickbook.com> wrote in message
> news:3B0ACE55.60105@thickbook.com...
> > I believe you want to look at this page:
> > http://www.thickbook.com/books/phpfe_errata.phtml
> >
> >
> >
> > --
> > +----------------------------------------+
> > | Julie Meloni (julie@thickbook.com) |
> > | |
> > | "PHP Essentials" and "PHP Fast & Easy" |
> > | http://www.thickbook.com |
> > +----------------------------------------+
> >
> >
> > --
> > 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
>