Hi there,
I,m quite new to PHP/MySQL and I've hit a problem. When I run this code the names of the tables are not appearing. Instead I'm getting "Array" in place of each expected table name, can somebody please explain? I'm trying to follow some tutorials and this is causing a real block!
<?
$connection = @mysql_connect ()
or die ( "Could not connect to database!" );
$dbs = @mysql_list_dbs ( $connection ) or die ( "Could not list databases" );
$db_list = "<ul>";
$i = 0;
while ( $i < mysql_num_rows ( $dbs )) {
$db_names [$i] = mysql_tablename ( $dbs, $i );
$db_list .= "<li>$db_names [$i]";
$i ++;
}
$db_list .= "</ul>";
?>
<head>
<title>MySQL DataBases!</title>
<body>
<p><h3> DataBases on Localhost </h3></p>
<?
echo "$db_list";
?>
</body>
I,m quite new to PHP/MySQL and I've hit a problem. When I run this code the names of the tables are not appearing. Instead I'm getting "Array" in place of each expected table name, can somebody please explain? I'm trying to follow some tutorials and this is causing a real block!
<?
$connection = @mysql_connect ()
or die ( "Could not connect to database!" );
$dbs = @mysql_list_dbs ( $connection ) or die ( "Could not list databases" );
$db_list = "<ul>";
$i = 0;
while ( $i < mysql_num_rows ( $dbs )) {
$db_names [$i] = mysql_tablename ( $dbs, $i );
$db_list .= "<li>$db_names [$i]";
$i ++;
}
$db_list .= "</ul>";
?>
<head>
<title>MySQL DataBases!</title>
<body>
<p><h3> DataBases on Localhost </h3></p>
<?
echo "$db_list";
?>
</body>