mysql_escape_string() vs addslashes()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

mysql_escape_string() vs addslashes()

Post by raghavan20 »

1. Can any of you tell me with an example, what is the difference between mysql_escape_string() and addslashes()?
2. Which should I use mysql_escape_string() or mysql_real_escape_string()? Are there any particular contexts in which they have to applied accordingly?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

these have been talked about several times in several threads in the last day... look around please.
Post Reply