PC Nerd Posted May 30, 2007 Share Posted May 30, 2007 hi guys, i cant seem to find the error in this code: $db = mysql_connect($dbHost, $dbUsername, $dbPassword) or die("connection failed"); $db_select = mysql_select_db($databasename, $db) or die("no selection"); i have checked the variables above. if there was no such database, would it return an error such as "no database in MySQL"? thanks Link to comment https://forums.phpfreaks.com/topic/53546-select-database-error/ Share on other sites More sharing options...
MadTechie Posted May 30, 2007 Share Posted May 30, 2007 what the error is ? $db = mysql_connect($dbHost, $dbUsername, $dbPassword) or die(mysql_error()); $db_select = mysql_select_db($databasename, $db) or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/53546-select-database-error/#findComment-264606 Share on other sites More sharing options...
PC Nerd Posted May 30, 2007 Author Share Posted May 30, 2007 Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in etc. Link to comment https://forums.phpfreaks.com/topic/53546-select-database-error/#findComment-264611 Share on other sites More sharing options...
chigley Posted May 30, 2007 Share Posted May 30, 2007 So the error is with the first line. Comment out the second and let's see the error in the first. Link to comment https://forums.phpfreaks.com/topic/53546-select-database-error/#findComment-264615 Share on other sites More sharing options...
spode Posted May 30, 2007 Share Posted May 30, 2007 try double checking your connection info Link to comment https://forums.phpfreaks.com/topic/53546-select-database-error/#findComment-264619 Share on other sites More sharing options...
PC Nerd Posted May 30, 2007 Author Share Posted May 30, 2007 ive checked, and checked, and lost count Link to comment https://forums.phpfreaks.com/topic/53546-select-database-error/#findComment-264622 Share on other sites More sharing options...
trq Posted May 30, 2007 Share Posted May 30, 2007 Your connection is failing, pretty simple. Either your username, password or host are incorrect. Link to comment https://forums.phpfreaks.com/topic/53546-select-database-error/#findComment-264625 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.