List:General Discussion« Previous MessageNext Message »
From:Martin Ramsch Date:September 9 1999 7:01pm
Subject:Re: mqsql_list_dbs
View as plain text  
On Thu, 1999-09-09 14:14:54 +0100, Williams Mark wrote:
> I want to be able to output to a Web page a list of all the
> databases within a given MySQL installation. I have tried the
> following:
> 
> <?
> 	$con = mysql_connect("localhost", "root");
> 	$dbs = mysql_list_dbs("$con");
                              ^^^^^^ you also can leave out the quotes
> 	$i = 0;
> 	while ($i < mysql_num_rows) {
                    ^^^^^^^^^^^^^^ THAT'S IT!
> 		echo mysql_tablename($dbs, $i);
> 		$i++;
> 	}
> 	echo "Got Here";
> ?>

You forgot to give mysql_num_rows the result identifier paramater.
Try:  mysql_num_rows($dbs), and it should work.

Don't mind, it so easy to overlook such things! :)

Regards,
  Martin
-- 
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=52 44 5E F3 B0 B1 38 26  E4 EC 80 58 7B 31 3A D7
Thread
mqsql_list_dbsWilliams Mark9 Sep
  • Re: mqsql_list_dbsMartin Ramsch9 Sep