Mysql update when data has quotes- problem!

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
h123z
Forum Newbie
Posts: 7
Joined: Tue Sep 18, 2007 5:18 am

Mysql update when data has quotes- problem!

Post 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!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I don't recall mysql_real_escape_string() doubling double quotes, so I suspect its something else.
Post Reply