ShaolinF Posted June 17, 2008 Share Posted June 17, 2008 Hi Guys, How can I write a script to inform me of what DBs I currently have on my server? Quote Link to comment https://forums.phpfreaks.com/topic/110614-find-all-dbs-on-server/ Share on other sites More sharing options...
wildteen88 Posted June 17, 2008 Share Posted June 17, 2008 Run the SHOW DATABASES mysql query. Quote Link to comment https://forums.phpfreaks.com/topic/110614-find-all-dbs-on-server/#findComment-567484 Share on other sites More sharing options...
ShaolinF Posted June 17, 2008 Author Share Posted June 17, 2008 Thanks. I have tried the following but it just gives me a blank page: $result = mysql_query('SHOW DATABASES') or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo '<p>' . $row['database'] . '</p>'; } Quote Link to comment https://forums.phpfreaks.com/topic/110614-find-all-dbs-on-server/#findComment-567496 Share on other sites More sharing options...
wildteen88 Posted June 17, 2008 Share Posted June 17, 2008 When you get blank pages alwaysturn display_errors On and make sure error_reporting is set to E_ALL Anyway $row['database'] should be $row['Database'] Quote Link to comment https://forums.phpfreaks.com/topic/110614-find-all-dbs-on-server/#findComment-567536 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.