Jump to content

Recommended Posts

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

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.