Angeleyezz Posted August 11, 2011 Share Posted August 11, 2011 ok, i have wamp installed on my machine, and for some reason whenever i try to access a database, even with the simplest command "eg: mysql_list_dbs" the only thing that comes up is the word "information_schema" there are a few other dbs created in the directory and i don't understand why that one is the only one being listed. Quote Link to comment https://forums.phpfreaks.com/topic/244526-mysql_list_dbs-problem/ Share on other sites More sharing options...
AyKay47 Posted August 11, 2011 Share Posted August 11, 2011 are you sure that they are actual databases and not tables? Quote Link to comment https://forums.phpfreaks.com/topic/244526-mysql_list_dbs-problem/#findComment-1256000 Share on other sites More sharing options...
Angeleyezz Posted August 11, 2011 Author Share Posted August 11, 2011 yeah their definitally databases Quote Link to comment https://forums.phpfreaks.com/topic/244526-mysql_list_dbs-problem/#findComment-1256003 Share on other sites More sharing options...
AyKay47 Posted August 11, 2011 Share Posted August 11, 2011 are you using a while loop to display the databases..? if you are expecting multiple databases.. you will need to use a while loop to output all of them <?php $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"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/244526-mysql_list_dbs-problem/#findComment-1256009 Share on other sites More sharing options...
Angeleyezz Posted August 11, 2011 Author Share Posted August 11, 2011 i figured out the problem, im using a fresh wamp, and theres no password or login for my databases, "its just a local setup for my own use, nothing live" but i left the login field blank with "" instead i should have put "root" in there for the user....... im soo dumb Quote Link to comment https://forums.phpfreaks.com/topic/244526-mysql_list_dbs-problem/#findComment-1256011 Share on other sites More sharing options...
AyKay47 Posted August 11, 2011 Share Posted August 11, 2011 yeah you need to specify the host.. no problem glad you figured it out Quote Link to comment https://forums.phpfreaks.com/topic/244526-mysql_list_dbs-problem/#findComment-1256014 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.