SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jun 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    One-to-one relationship?

    Can someone please lend expertise to the following? Also, is this called a one-to-one relationship?

    I have a table containing name and id of a wireless access point. Each access point has two or three radios. Each radio has ten separate items requiring unique configuration details. I would like to do this:

    table accessPoint
    ap_id
    ap_name
    radio1 (value of rc_id below)
    radio2 (value of rc_id below)
    radio3 (value of rc_id below)

    table radio_config
    rc_id
    config_item1
    config_item2
    config_item3
    .
    .
    config_item10

    I feel doing this would be better than having the accessPoint table containing 30 different fields.

    My question is, what is the best method for tying the two tables together?

    Thanks in advance.

  2. #2
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,033
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    Add a 3rd "linking" table with 2 fields ap_id and rc_id each row would record 1 radio and access point combination.
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  3. #3
    SitePoint Member
    Join Date
    Jun 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    okay, thanks for the reply.

    then I would have this:

    table ap_rc
    ap_id
    rc_id

    What type of query would I write to obtain:

    all access points with 'config_item1' = 'x'


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •