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 Quote Link to comment 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()); Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
spode Posted May 30, 2007 Share Posted May 30, 2007 try double checking your connection info Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.