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? Link to comment https://forums.phpfreaks.com/topic/80184-solved-mysql-error-any-ideas/ 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. Link to comment https://forums.phpfreaks.com/topic/80184-solved-mysql-error-any-ideas/#findComment-406404 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? Link to comment https://forums.phpfreaks.com/topic/80184-solved-mysql-error-any-ideas/#findComment-406407 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'); Link to comment https://forums.phpfreaks.com/topic/80184-solved-mysql-error-any-ideas/#findComment-406412 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? Link to comment https://forums.phpfreaks.com/topic/80184-solved-mysql-error-any-ideas/#findComment-406414 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. Link to comment https://forums.phpfreaks.com/topic/80184-solved-mysql-error-any-ideas/#findComment-406416 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.