Jump to content

mysql_list_dbs problem


Angeleyezz

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/244526-mysql_list_dbs-problem/
Share on other sites

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";
}
?> 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.