View Full Version : Check Boxes?
07-28-2002, 03:28 AM
Hello, can I put checked boxes all in the same feild in MySQL?
and then beable to get them back as varables?
07-28-2002, 06:15 AM
Do you mean check boxes or radio buttons?
07-28-2002, 06:16 AM
07-28-2002, 06:26 AM
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?
07-28-2002, 06:28 AM
Well, if I make a table structure; can I add a new field to it?
07-28-2002, 06:31 AM
If this is going to be a relational database then you simply need to normalize the database.
07-28-2002, 06:31 AM
07-28-2002, 06:39 AM
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.
07-28-2002, 07:02 AM
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?
07-28-2002, 07:05 AM
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.
07-28-2002, 08:34 AM
Show some code please.
07-28-2002, 09:32 AM
There's no code for this. This is just basic concepts of database design.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.