dhillon555 Posted June 5, 2009 Share Posted June 5, 2009 I am getting the following error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\"tom\"' at line 1 This is my code any help would be great $username = ($_SESSION['myusername']); $query = "SELECT user_info.username, user_info.`password`, user_info.UserID, user_info.EmailAddress, user_info.Address, user_info.Postcode, user_info.FirstName, user_info.LastName FROM user_info WHERE user_info.username = '$username'"; $results = mysql_query(mysql_escape_string($query)) or die(mysql_error()); while ($row = mysql_fetch_array($results)) { extract($row); echo $username; echo $password; echo $UserID; echo $EmailAddress; echo $Address; echo $Postcode; echo $FirstName; echo $LastName; } ?> Link to comment https://forums.phpfreaks.com/topic/161009-sessions-in-mysql-query/ Share on other sites More sharing options...
roopurt18 Posted June 5, 2009 Share Posted June 5, 2009 Don't duplicate post; you already have a topic for this. Link to comment https://forums.phpfreaks.com/topic/161009-sessions-in-mysql-query/#findComment-849748 Share on other sites More sharing options...
Recommended Posts