Chris McGee Posted December 4, 2007 Share Posted December 4, 2007 Got everything looking great for my login.php and this is what I get when I try logging in. Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/purseati/public_html/Connections/users.php on line 50 Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'purseati'@'localhost' (using password: NO) in /home/purseati/public_html/Connections/users.php on line 8 Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /home/purseati/public_html/Connections/users.php on line 8 Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'purseati'@'localhost' (using password: NO) in /home/purseati/public_html/Connections/users.php on line 8 Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /home/purseati/public_html/Connections/users.php on line 8 Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/purseati/public_html/Connections/users.php on line 55 Access denied for user 'purseati'@'localhost' (using password: NO) Any ideas? Quote Link to comment Share on other sites More sharing options...
revraz Posted December 4, 2007 Share Posted December 4, 2007 You don't have a DB Connection. So your Resource errors and your mysql_real_escape_string will also error since it relies on a DB connection. Quote Link to comment Share on other sites More sharing options...
Chris McGee Posted December 4, 2007 Author Share Posted December 4, 2007 How do i go about fixing that issue? Quote Link to comment Share on other sites More sharing options...
revraz Posted December 4, 2007 Share Posted December 4, 2007 Establish a database connection. $host="yourhost"; $user="username"; $pass="dbpw"; $db="dbname"; $connection = mysql_connect($host,$user,$pass)or die ('Unable to connect'); mysql_select_db($db) or die ('Unable to select DB'); Quote Link to comment Share on other sites More sharing options...
Chris McGee Posted December 4, 2007 Author Share Posted December 4, 2007 One last newbie question, Thank you so much for your help... Where does that script go? Quote Link to comment Share on other sites More sharing options...
revraz Posted December 4, 2007 Share Posted December 4, 2007 Depends, you can put it in a connection.php file and use it as a include or you can enter it on every page that requires the connection. It just has to be established before you do any DB related activities. 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.