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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.