faces3 Posted April 23, 2013 Share Posted April 23, 2013 How display all database in php checkbox / dropdown list where can choose what database connect. Link to comment https://forums.phpfreaks.com/topic/277202-display-all-database-in-checkbox/ Share on other sites More sharing options...
jugesh Posted April 23, 2013 Share Posted April 23, 2013 <?php// Usage without mysql_list_dbs()$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');$res = mysql_query("SHOW DATABASES");while ($row = mysql_fetch_assoc($res)) { echo $row['Database'] . "\n";}// Deprecated as of PHP 5.4.0$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');$db_list = mysql_list_dbs($link);while ($row = mysql_fetch_object($db_list)) { echo $row->Database . "\n";}?> Link to comment https://forums.phpfreaks.com/topic/277202-display-all-database-in-checkbox/#findComment-1426086 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.