1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

2 questions

Discussion in 'Databases' started by jnm, Dec 18, 2005.

  1. #1
    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.
    SEMrush
    Justin
     
    jnm, Dec 18, 2005 IP
    SEMrush
  2. theblackjacker

    theblackjacker Peon

    Messages:
    52
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I guess there are scripts for most things..
     
    theblackjacker, Dec 20, 2005 IP
  3. tandac

    tandac Active Member

    Messages:
    337
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #3
    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.
     
    tandac, Dec 20, 2005 IP