FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


stripping slashes





imagefree
when you apply addslashes() on any variable before submitting to database (mysql), is there any need to apply stripslashes() when fetching the same from database?

I am previously applying the same to the data fetched from database but now i have noticed that there is no such need.
I have tested the same and the putcome support my new thought.

I need you help in this regard because i cant use this much sensitive change to the code before being sure about its of being no use.
jmraker
The addslashes is to avoid SQL errors like
Code:
UPDATE table SET field='word1 'quote1' word2';
or
Code:
UPDATE table SET field="word1 "quote1" word2";


Where you can't have quotes inside of quotes.
When you add slashes, SQL will remove the slashes and run the SQL without them.
imagefree
please reply.
Hogwarts
No, there isn't Rolling Eyes

And at the risk of making myself look like an idiot, I'm going to teach you an acronym of which somebody like you should have been told many, many times.

RTFM
imagefree
Hogwarts wrote:
No, there isn't Rolling Eyes

And at the risk of making myself look like an idiot, I'm going to teach you an acronym of which somebody like you should have been told many, many times.

RTFM


Offline manual doesnt explain too much.
Online manual has an illustration http://www.php.net/manual/en/function.stripslashes.php#73418 (and this is what i am already doing), but i think there is no need to use stripslashes() on results from database.
imagefree
Hogwarts wrote:
No, there isn't Rolling Eyes

And at the risk of making myself look like an idiot, I'm going to teach you an acronym of which somebody like you should have been told many, many times.

RTFM


Offline manual doesnt explain too much.
Online manual has an illustration http://www.php.net/manual/en/function.stripslashes.php#73418 (and this is what i am already doing), but i think there is no need to use stripslashes() on results from database. i just need responses from experienced php developers.
AOP Web Development
you can youse the mysql_escape_string and theres nothing to stripslash in fetching your data from db.
rockkornman
there is no need to apply stripslashes() when fetching from your data base.
pollux1er
I think it depends of mysql engine. Some are removing slashes from data some not.
Related topics
naruto Discussion
coputers jokes ! this jokes dont post here ...
Need help with iTunes..
Windows XP the best?
pagina niet weergegeven
PS3 vs Xbox 360
Windows 98
PHP Login Problem
Php sms
Network Path Not Found
environment
How to update database?
What is the diffence between Raid 0 and Raid 1?
Slashes in POST and REQUEST query's
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.