Jump to content

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

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.