...

View Full Version : "Error: No Database Selected"



Phantom
02-27-2003, 11:38 PM
I get MySQL Err Num 1046 - No Database Selected when I put this code in...


require("common.inc.OLD.php"); // nevermind why I named it that
$link = mysql_connect($database, $database_user, $database_password); // all is in config.dat.php, which is requried thru common.inc
mysql_select_db($database);

Is that not right? :(

Nightfire
02-27-2003, 11:48 PM
I think it's mysql_db_select($database)

Use it all the time and I can't remember how it goes now :p

Phantom
02-27-2003, 11:55 PM
Nope :(

Nightfire
02-27-2003, 11:57 PM
Ahh, I see why now

It should be


require("common.inc.OLD.php"); // nevermind why I named it that
$link = mysql_connect(localhost, $database_user, $database_password); // all is in config.dat.php, which is requried thru common.inc
mysql_select_db($database);


Or if $database is localhost, change mysql_select_db($database) to whatever your database is named, like mysql_select_db($databasename)

Phantom
02-28-2003, 01:14 AM
There we go :)

Thanks - programming for a game I haven't programmed for since October...tough tryin to get back to it :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum