p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

php_databases thread: Connection to mysql db using a web browser


Message #1 by "Lamine" <guindal@h...> on Wed, 21 Mar 2001 13:33:01
Hi,

here is the message
"
Internal Server Error
The server encountered an internal error or misconfiguration and was 
unable to complete your request.
Please contact the server administrator, root@l... and inform them of 
the time the error occurred, and anything you might have done that may 
have caused the error.

More information about this error may be available in the server error log.

"

and the code is


<?php


$link_id = mysql_connect("localhost", "phpuser", "phppass");
$result = mysql_list_dbs($link_id);
$num_rows = mysql_num_rows($result);


while ($db_data = mysql_fetch_row($result)) {

        echo $db_data[0]. "<br>";
        $result2 = mysql_list_tables($db_data[0]) ;
        $num_rows2 =mysql_num_rows($result2) ;
        while($table_data = mysql_fetch_row($result2)) echo "--" .

$table_data[0]. "<br>";
        echo"==> $num_rows2 table(s) in " . $db_data[0] . "<p>";


}

?>


  Return to Index