Jump to content

No database selected


ded

Recommended Posts

Not sure why this is happening?  Showing No database selected

 

The database does exist

 

$dbh=mysql_connect ("localhost", "website_dbname", "password") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("website_newdatabase"); 
$query = "SELECT * FROM `contacts` ORDER BY `rrn`";
$result = mysql_query($query,$dbh) or die(mysql_error());

Link to comment
https://forums.phpfreaks.com/topic/255601-no-database-selected/
Share on other sites

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.