Computer Programming Tutorials - Society 2007 - Find jobs - Find jobs - Debt Consolidation

PDA

View Full Version : 2 questions


jnm
Dec 18th 2005, 6:37 pm
Hi,

My first question - is it better to store related values in an array in one DB column to save space or is it better to have a seperate DB column for each? which is faster and more scalable? Example would be using name, email, address, etc in seperate columns or in a single column using a delimiter.

Second - trying to build a profile with a picture in a member area (kind of like this forum's profile section). I want the user to have the ability to add an avatar/picture limiting file size and extension (and/or edit anytime). Is there an easy script that I can use to do this?

Thanks.

Justin

theblackjacker
Dec 20th 2005, 10:10 am
I guess there are scripts for most things..

tandac
Dec 20th 2005, 7:19 pm
As mentioned above, there *are* scripts for doing most things but there's something to be said for doing it yourself. Learning, sense of accomplishment etc etc.

To answer your first question.
I would put each attribute as a seperate column. First name, last name, address, city, state, country, email address etc etc all go into their own column. The trick is that different groups of attributes go into different tables. This is called normalization and there are lots of good tutorials.

For example: customer name, address etc would go into a customer table but product information would go into a product table. You could then use a third table to determine what products where bought by what customers and so on.

Some thoughts on the second question... there should be lots of scripts to do this. It's surprising easy to accomplish it. Just do a couple of google searches and you should figure something out.