List:General Discussion« Previous MessageNext Message »
From:Douglas Brantz Date:April 24 2000 2:42pm
Subject:Re: Check Box question
View as plain text  
I've built several relational databases in Mysql, and no I don't take
what you say in a mean way.

My problem is that everything I've done has been very simple, there is
always a field for each piece of data etc.
I've never created the checkbox array with existing datafield from
another table and then store it in a third table.
This is what stumps me - I give a form which will populate the third
table (Links Table)  OK, so on the form I will
have a drop down menu of the Software name with the software id being
hidden to pass to the database.  Now,
on the same form I will have a fetchrow statement that will grab all the
lab names and place checkboxes next to them.
Here comes the problem or mental block for me - when the person checks
all the boxes they need and submits the
form all the info should go to the third table.  Ok so I pass the
software id and place that in its field of the links table.
Now, I need to place all the information about the checkboxes and the
lab id info into what field or fields?  I'm used to
having the table fields defined before it gets used - so with the
example above I can only imagine one field for all the checkbox
data and one field for all the lab ids, unless I create some type of

In the past I would have had a field in the third table (links table)
for each checkbox, but since it is growing all the time or
shrinking - I might have to place multiple answers in one field?  for

Links Table:

Link_id  = 1
Software_id =1
lab_id = 1, 2, 3, 4
Checkbox = checked, unchecked, checked, unchecked

I know that the first two tables will only have info on software only
and lab only data and that is already being built.
but would the links table above work the way I have it described above,
so when I call it back up to edit it and there are
more software titles and labs entered into the database it can be
changed easily.

I hope I'm asking an easy question - do I simply need to create fields
for Lab_id and the Checkbox return that will hold mulitple returns?
Or will I have to create a (I call them tickets- each form submitted)
for each piece of software and each lab?

Link_id = 1
Software_id = 1
Lab_id = 1
Checked = Checked

then another

Link_id= 2
Software_id = 1
Lab_id = 2
Checked = unchecked

etc?  Then when I call up the information for editing I can say select *
from Link table where Software_id = 1?  And if I have to do this I am
just not familiar with creating a loop to feed the information into the
links table.  Would this second example work better for me?

Thanks again for all your help,



Douglas Brantz
Computer Consultant
Fine & Applied Arts
Appalachian State University
Boone, NC 28608

828-262-6312 FAX
828-262-6549 OFFICE

Check Box questionDouglas Brantz23 Apr
  • RE: Check Box questionbenjamin-weiss24 Apr
    • Re: Check Box questionDouglas Brantz24 Apr
      • RE: Check Box questionbenjamin-weiss24 Apr