galahad3
01-23-2012, 04:09 PM
I'm having a problem when using mysql_real_escape_string to allow apostrophes to be inputted into fields in a mySQL db.
Basically it cuts off the value of the data after the first instance of an apostrophe. So "Testing testing's test testtesting" would be truncated to "Testing testing" and so forth.
I'm using this code:
$description = mysql_real_escape_string($_POST['_Description']);
And the query (which otherwise works fine) is:
$query = "UPDATE userdata SET RealName = '$realname', EmailAddress = '$emailaddress', YearOfBirth = '$yearofbirth', Profession = '$profession', Description = '$description' WHERE UserName = '$username'";
Any idea why it's doing this?
Thanks
Basically it cuts off the value of the data after the first instance of an apostrophe. So "Testing testing's test testtesting" would be truncated to "Testing testing" and so forth.
I'm using this code:
$description = mysql_real_escape_string($_POST['_Description']);
And the query (which otherwise works fine) is:
$query = "UPDATE userdata SET RealName = '$realname', EmailAddress = '$emailaddress', YearOfBirth = '$yearofbirth', Profession = '$profession', Description = '$description' WHERE UserName = '$username'";
Any idea why it's doing this?
Thanks