Hi,
I am learning, so excuse the simple question:
I can connect to my database in my php code but can't select the database in order to query it.
I was trying to see were it fails and when the code gets to db_connect, it prints the message I put in the mysql_select_db section (i.e. prints "failed in mysql_select_db')
function db_connect()
{
$result = @mysql_pconnect('localhost', 'dbname', '');
if (!$result){
echo 'failed in mysql_pconnect<br />';
return false;
}
if (!@mysql_select_db('dbname')){
echo 'failed in mysql_select_db<br />';
return false;
}
return $result;
}
Can someone tell me what can cause this?
TIA.