Not sure when to use stripslashes

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
green_coder
Forum Newbie
Posts: 7
Joined: Mon Oct 26, 2009 1:40 am

Not sure when to use stripslashes

Post by green_coder »

I really confused with stripslashes when being used to escape from quotes mysql_real_escape_string()

I always use it when trying to INSERT or UPDATE data so that i wont get any quote "\" inside my database..

When SELECT and DELETE data, i only used mysql_real_escape_string($value)
is this correctly used???

Thanks
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Not sure when to use stripslashes

Post by requinix »

Keep using mysql_real_escape_string.

stripslashes is only for when you have magic_quotes enabled - that's an entirely separate issue.
Post Reply