ohdang888 Posted March 7, 2008 Share Posted March 7, 2008 i am getting this error, several times from practically every line that has the escape string in it. Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in C:\xampp\htdocs\contact\adfeedback.php on line 21 and this is line 21 $location = mysql_real_escape_string($_POST['location']); Quote Link to comment https://forums.phpfreaks.com/topic/94845-real-escape-string-error/ Share on other sites More sharing options...
fert Posted March 7, 2008 Share Posted March 7, 2008 to use myql_real_escape_string you have to be connected to the mysql server Quote Link to comment https://forums.phpfreaks.com/topic/94845-real-escape-string-error/#findComment-485814 Share on other sites More sharing options...
kenrbnsn Posted March 7, 2008 Share Posted March 7, 2008 That functions needs a connection to MySQL to be established before being used. Have you done that? (fert: GMTA) Ken Quote Link to comment https://forums.phpfreaks.com/topic/94845-real-escape-string-error/#findComment-485815 Share on other sites More sharing options...
ohdang888 Posted March 7, 2008 Author Share Posted March 7, 2008 ohhhhh.... no. i tried to validate everything people i set the connection. I thought it would save computing power by not connecting until its needed... but apparently its needed sooner than i had thought.. Thanks for the quick response! Quote Link to comment https://forums.phpfreaks.com/topic/94845-real-escape-string-error/#findComment-485818 Share on other sites More sharing options...
ohdang888 Posted March 7, 2008 Author Share Posted March 7, 2008 oh and one more quick question!! EDIT: NVM, solved Quote Link to comment https://forums.phpfreaks.com/topic/94845-real-escape-string-error/#findComment-485820 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.