Answer the question
In order to leave comments, you need to log in
Show all databases php not working?
The code works fine in the local server.
$result = mysql_query("SHOW DATABASES");
while ($row = mysql_fetch_array($result)) {
echo $row[0]."<br>";
}
Warning: mysql_fetch_array() expects parameter 1 to be resource
Answer the question
In order to leave comments, you need to log in
1) Yeah, and it should also give out something like:
2) The request to the database did not return anything, $result is empty. Run error checking after the request and find out what's wrong.
$result = mysql_query("SHOW DATABASES");
die(mysql_error());
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question