PDA

View Full Version : What is the different between mysql_escape_string() and addslashes() ?


kaisellgren
08-09-2006, 11:09 PM
Hi,

Can someone please tell me the difference between mysql_escape_string() and addslashes() ?

PHP doc just said they both escape some special chars like quotes...

Fumigator
08-10-2006, 12:27 AM
One is a mysql C api function, the other is a php function. BTW you'll want to use mysql_real_escape_string() rather than the depreciated mysql_escape_string().

kaisellgren
08-10-2006, 12:30 AM
But should I use addslashes or mysql_real_escape_string ?

Kid Charming
08-10-2006, 12:41 AM
mysql_real_escape_string()