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
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!