hi, i am having a problem selecting a mysql database once i've connected to mysql. This is what i've got:
$link = mysql_connect ("localhost", "root", "");
if(!$link)
{
$dberror= "Couldn't connect to MySQL";
return false;
}
this connects fine and i dont get any errors, but when i try to select a database, it won't connect:
$databaseName = "MailingList"
$sdb = mysql_select_db($databaseName, $link);
if(!$sdb)
{
$dberror= mysql_error();
return false;
}
i always get an error: No Database Selected
I used this command to show the available databases:
$db_list = mysql_list_dbs($link);
while ($row = mysql_fetch_object ($db_list)){
echo $row->Database . "<p>";
}
This printed out 2 available database, MailingList and mysql. So i know that it is connecting to mysql and that these databases are available but i cant select them. Can anyone please tell me what i am doing wrong and why i keep getting a No Database Selected error when i try to select a database? thanx.