http://www.jbai2.com/vs.php
Values have been selected from their table as such:
$sql08 = "SELECT * FROM vendor_table WHERE clientID='$clientID' ORDER BY vendor_name";
$counter = 1;
// put data into checkboxes
while ($row = mysql_fetch_array($result08)) {
$vendorID = $row["vendorID"];
$vendor_name = $row["vendor_name"];
$vendor_block .= "<input type=\"checkbox\" value=\"$vendorID\">$vendor_name ($counter)<br>";
$counter ++;
}
?>
Select Vendors
<?php
echo $vendor_block;
echo "<br>";
?>
And as you can see, things are working well...
THE PROBLEM
The vendor selection is one section of a form ...
a client will be able to choose specific vendors from a list of all their vendors as far as who will have access to a specific job_order --
each new job_order will be offered to specific vendors
(the selection of the checkboxes)
I am going to create a new table called "assigned_vendors", which will record all of the checkboxes that were picked.
mySQL TABLE : assigned_vendors
COLS :
avID (auto-created)
jobID (so I can keep assigned vendors connected to the job)
vendorID (for later joins)
clientID (for later joins)
vendor_name (for easy identification)
bidding_allowed (this one shows that the box was checked or not)
How do I get the table to write a new row for each vendor and then differentiate if the checkbox was selected or not???
(the client needs to be able to go back and turn vendors on and off -- so all vendors must get inserted into the new table for each job_order)
The rest of the fields and inputs are all being captured into another table -- it's just this specific data that needs to be treated differently.