Archive for August 24th, 2007

How to write paragraphs to mysql with quotes(’ and “)

Friday, August 24th, 2007

Php provides a function called addslashes ( string $str )

What addslashes do?

It returns a string with backslashes before characters that needed to be quoted in database queries . Example characters are single quote (), double quote (), backslash (\)

How to use it?

$yourvariable=“is html does good’s “ ;

echo $yourvariable;

// this outputs "is html does good\’s"

$yourvariable=addslashes($yourvariable);

Posted by Suresh B