views:

192

answers:

1

How to update serialized data in DB Table field?

I want to store serialized data to reduce count of queries but don't have idea how to update them.

+1  A: 

You have to fetch the serialized data, unserialize() it, change it, serialize() it back again and update the table row in the database with the new serialized data.

This is too slow / troublesome, and it's the reason you shouldn't be storing serialized data in the DB.

Alix Axel
Now I see, but can you recommend me the way to reduce queries in my app? It's fast, yes it is, but wanna reduce queries.
greegs
@greegs: Don't rely on serialized data and design your database very well.
Alix Axel