Re: mysql - image storing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Joseph Crawford wrote:
Jason, can you explain why stripslashes should not be used on data
taken from the db? when you store data in the db i thought it was good

although 'slashing' text works pretty much all of the time (possibly the guys using exotic encodings all day will say different :-) but the data you are storing in the DB is binary - stripping and slashing will probably do weird things to the data:


try creating some image data and run it thru add_slashes() and stripslashes() and compare the output of each with the original.

practice to addslashes, when you retrieve from the db, you will need

why is it good practice? (anyone)? sounds like pure overhead to me.
you could look up 'magic quotes' in relation to this, its often where the trouble starts!



on a side note:
-----------------
me I use the ibase/firebird php extension which has parameterized queries - so I can say goodbye to mysql_escape_arg() (or whatever the damn function is called) and having to hand craft lots of arg checks -
but alas you may not have access to a firebird DB.



to use stripslashes to remove the extra \



-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux