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? 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. 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>'; } 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'] 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
Archived
This topic is now archived and is closed to further replies.