Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12

Thread: Check Boxes?

  1. #1
    New Coder
    Join Date
    Jul 2002
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Check Boxes?

    Hello, can I put checked boxes all in the same feild in MySQL?
    and then beable to get them back as varables?

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Do you mean check boxes or radio buttons?
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    New Coder
    Join Date
    Jul 2002
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Check boxes......

  • #4
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Well since checkboxes have different values you would have to concantenate all the values together using some kind of distinguishing separating character. Then to retrieve them you would have to split the string back up based on the seperator used. Why would you want to put multiple values into one field?
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #5
    New Coder
    Join Date
    Jul 2002
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, if I make a table structure; can I add a new field to it?

  • #6
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    If this is going to be a relational database then you simply need to normalize the database.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #7
    New Coder
    Join Date
    Jul 2002
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts
    huh?

  • #8
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    It sounds like you have a multivalued attribute situation. That just means you have a situation where you have an indefinite number of values that will go with a particular record. I'll try and not use to much db lingo. I do this for a living. lol

    For example lets say you have a table that you wanted to store personal info on an employee. Lets say you wanted to list that employees family members. Well not every employee would have the same number of family members so logically they could not be columns in the same table as the employee info. In this case you would list them in another table and link the tables together based off of some unique field in the employee table such as their employee id or SSN.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #9
    New Coder
    Join Date
    Jul 2002
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well I know how to do it with each check box it's own field, but once I make all the fields, can I make a new field if I add a new check box?

  • #10
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    You really don't need to add columns to a table. That is one of the purposes of creating a relational database. In your case you would use another table and just add records for each checkbox value. Those values would be related to a certain record in the other table.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #11
    New Coder
    Join Date
    Jul 2002
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Show some code please.

  • #12
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    There's no code for this. This is just basic concepts of database design.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster


  •  

    Posting Permissions

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