Gossamer Forum
Home : General : Databases and SQL :

Multiple Values in one Column

Quote Reply
Multiple Values in one Column
Hi,

I just installed a PHP/MySQL application that stores some user details/settings in one column like this -

a:4:{s:17:"signup_email_sent";i:1;s:6:"status";a:1:{i:3;i:1;}s:9:"is_active";i:1;s:9:"is_locked";s:0:"";}

I'm wondering if this is a good thing or not?

Any comments?

Thanks

Simon.
Quote Reply
Re: [jai] Multiple Values in one Column In reply to
Definitley not normalized to say the least. It is best to insert those multiple values into separate columns...because if you don't, you'll have to rely on explode and/or preg_match functions in PHP to parse that string, which is intensive to both your web server and database server.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [jai] Multiple Values in one Column In reply to
Eliot is right. I don't think you realise what you are letting yourself into. I tried doing this recently for a client, and although I managed to get it working, it took 20 times longer than doing it in their own seperate columns.

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates