Jump to content

mysql_real_escape_string issue in php code


mattiesams

Recommended Posts

hi,

 

when i try to add inter'l in the field i'm getting below error message.

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 'L', '')' at line 4

 

but i have put

$sql = "UPDATE inv SET ";

$sql .= ", TO_LOC3 = '".mysql_real_escape_string($_SESSION['dloc3'])."'";

$sql .= " WHERE JOB_NO = ".$_SESSION['jobno'];

 

but when i go back using back button , i can see that inter'l  already in the field.

then again if i tried to delete that , then i'm getting above error message.

this is how i call data

$sql = "SELECT * FROM inv WHERE JOB_NO = ".$id;

$db->query($sql);

if ($row = $db->next_record()) {

$_SESSION['dloc3'] = stripslashes($row['TO_LOC3']);

 

 

can someone help me please to solve this

many thanks

 

 

if that field is total empty if i try to input internation'l there, then i get then i'll get this 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 'L')' at line 4

 

then when i go back clicking back on error screen then i can see internation'l

 

when i echo sql i can see internation'l

 

Archived

This topic is now archived and is 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.