Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 199903

Re: [PHP3] [HOW TO] Passing serialized data around From: Auke van Slooten (auke <email protected>)
Date: 03/29/99

On Sun, 28 Mar 1999, Sascha Schumann wrote:

> On Sun, Mar 28, 1999 at 01:46:50PM +0200, Auke van Slooten wrote:
> > On Sat, 27 Mar 1999, Sascha Schumann wrote:
> >
<snip>
> >
> > well, that would be allright, except you forgot that this is about using
> > AddSlashes/Stripslashes, and StripSlashes hasn't been applied at this
> > point. The next two lines in the original post are:
>
> Why would you want to use stripslashes then?? There is normally no (not even
> closely one) application for stripslashes in a database context.
>
<snip>
>
> I don't consider it too hard to understand that you only need to use
> addslashes when you want to put something into a database. Do NOT apply
> stripslashes to data you fetch from a database.
>

After reading up on AddSlashes/StripSlashes I must confess that you are
absolutely right.. sigh (mental note: RTFM) The original post of mr Colin
Viebrock said though:

> If you are storing serialized data in a database, you need to
> serialize() the data, then addslashes(), then stick it in the DB.
>
> When you pull it out, stripslashes(), then unserialize().

So, just don't use StripSlashes and everything works fine! :)

Thanks for your patience,
Auke van Slooten
 

--
PHP 3 Mailing List   http://www.php.net/
To unsubscribe send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest list:  php3-digest-subscribe <email protected>
For help: php3-help <email protected>  Archive:  http://www.php.net/mailsearch.php3
List administrator:  zeev-list-admin <email protected>