Page 1 of 1

Mysql update when data has quotes- problem!

Posted: Mon Dec 03, 2007 10:04 am
by h123z
Hi!
I'm trying to write a php script to upload data into my database.
this works unless the data has double quotes in it- it then uploads with double double quotes (ie, <she said "hi"> will update as <she said ""hi"">
how do i get rid of these double quotes??
my code:
$abc = trim(mysql_real_escape_string(str_replace('\r\n','',$abc)));

$sqlf="UPDATE table1 SET abc ='$abc' WHERE key = '$key'";

Thank you!

Posted: Mon Dec 03, 2007 10:39 am
by feyd
I don't recall mysql_real_escape_string() doubling double quotes, so I suspect its something else.