#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    Loughborough
    Posts
    1
    Rep Power
    0

    Question Database normalisation challenge.... Please help!??!?!?!


    Hi,

    I am struggling with my final year project and need some help on my database structure.... Please can someone help!?!?!

    I am trying to build a web portal using PHP and MySQL and have sucessfully built and integrated the pages that customise a login to the user.

    I need to include a set of links specific to a user and I cannot get my head around the database structure that would make this easiest.

    I have a user_info table that stores the information about the user that is in a reasonable 1st normal form.

    The fields are:

    user_id
    user_password
    user_firstname
    user_surname
    user_room
    user_building
    user_telephone
    user_email
    user_lastaccess

    I cannot relate this to the information that I require about the link's though without creating lots of many-to-many relationships and therefore duplicate data.

    The attributes I need to store for the links are:

    user_id
    link_url
    link_description
    link_type (text or graphic)
    link_type_resource (i.e. location of graphic)
    link_pos_x (relating to a row in a table so that the links can be sorted)
    link_pos_y (relating to a column in a table)

    If anyone can help me with this it would be greatly appreciated as time is starting to run out, as is my hair!!!!

    Many thanks

    -=oLd SkOoL RaVeR=-
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2002
    Posts
    170
    Rep Power
    13
    What I assume you want is three tables

    table_1 : Unique data about each user
    table_2 : Unique data about a link
    table_3 : many to many link table

    what's so wrong with that ?
    Candyman. CandyMan. Candy ... Oh, Hi !
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Jul 2001
    Location
    Oslo
    Posts
    1,516
    Rep Power
    15
    Don't you learn techniques for database design? This example looks fairly simple, but a good idea is to model the database using ORM or E/R. (Don't use UML, it's hopeless for this purpose!).
    --
    Regards
    André Nęss

    Puritanism: The haunting fear that someone, somewhere may be having fun

IMN logo majestic logo threadwatch logo seochat tools logo