Forum Moderators: coopster

Message Too Old, No Replies

php mysql single quote escape

single quote escape my addslashes and stripslashes

         

sanji41

2:25 am on Aug 20, 2010 (gmt 0)

10+ Year Member



hi! i have a code output from mysql DB, when i inserted a text with single quote it comes with (text\')like that w/o the parenthesis..im using addslashes and mysql_real_escape_string and stripslashes so how come this single quote can still be visible..im using php and mysql..hope someone can help. :)

Anyango

10:16 am on Aug 20, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



with mysql_real_escape_string , addslashes isnt a must imo. try saving with first one

Anyango

10:17 am on Aug 20, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



$value="testin testin this 'n that ";

$value=mysql_real_escape_string($value);

should save fine and wont need stripslashes before output