Hi Cliff,

Cliff Hirsch wrote on Sunday, October 22, 2006 7:08 AM:
> Is serializing/unserializing object/arrays for storage/retrieval in a
> MySQL db truly reliable? It would be awfully handy, but the PHP
> manual notes list various issues that make me wary.  

I would frankly recommend against it.  While it's possible if you're
careful, there can be a lot of surprises, such as:

-- unserialized objects aren't quite what you may expect them to be (ie, the
definition of the class either has changed or doesn't exist)

-- it's slow

-- it doesn't give you any type of normalization - ie, the object's data is
relationally useless - and you end up having to do text matching to find
anything

There are some other options, that may be better:

http://us3.php.net/wddx

Although it has it's downfalls too.  End of the day, I'd try to avoid
serializing objects - serializing arrays and scalar types, though not
optimized in PHP (ie, slow), is much more reliable.

---
Hans Zaunere / President / New York PHP
   www.nyphp.org  /  www.nyphp.com


_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to