php3-list | 199903
Date: 03/26/99
- Next message: Bram Heerink: "[PHP3] does include return something"
- Previous message: auke <email protected>: "Re: [PHP3] [HOW TO] Passing serialized data around"
- In reply to: auke <email protected>: "Re: [PHP3] [HOW TO] Passing serialized data around"
- Next in thread: auke <email protected>: "Re: [PHP3] [HOW TO] Passing serialized data around"
- Reply: auke <email protected>: "Re: [PHP3] [HOW TO] Passing serialized data around"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, Mar 26, 1999 at 11:59:26AM +0100, auke <email protected> wrote:
> On Thu, 25 Mar 1999, Colin Viebrock wrote:
>
> > FYI, This is a summary of the info in the annotated manual at:
> >
> > http://ca.php.net/manual/function.serialize.php3
> >
> > It's been asked a lot lately, so I thought I'd post my findings.
> >
> >
> >
> > A) DATABASE
> >
> > 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().
> >
> > [Your server may be configured so the addslashes and stripslashes
> > are automagically done for you.]
> >
>
> Hi,
> I've got a question about this. I'm using MySQl to store serialized
> data, but I don't use AddSlashes, I use ereg_replace("'","''",...)
> I've tried to use AddSlashes/StripSlashes, but it seems that this can
> corrupt the data. e.g.
>
> Suppose you have a string $temp="a \\'string";
echo $temp
a \'string
You are overseeing that PHP also uses slashes.
$temp = "a \\\\'string";
echo $temp."\n";
a \\'string
echo addslashes($temp)."\n";
a \\\\\'string
--Regards,
Sascha Schumann | Consultant | finger sas <email protected> | for PGP public key
-- 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>
- Next message: Bram Heerink: "[PHP3] does include return something"
- Previous message: auke <email protected>: "Re: [PHP3] [HOW TO] Passing serialized data around"
- In reply to: auke <email protected>: "Re: [PHP3] [HOW TO] Passing serialized data around"
- Next in thread: auke <email protected>: "Re: [PHP3] [HOW TO] Passing serialized data around"
- Reply: auke <email protected>: "Re: [PHP3] [HOW TO] Passing serialized data around"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

