Hello everyone,
I am grabbing workshop names from a database table. I want to print these workshop names in a form and allow them to check which workshops they want through a checkbox. I have this part done.
My problem is that the name of each checkbox is the same. Therefore I have no way to determine which boxes were checked.
Here's my code:
print"<tr><th>Workshops</th><td>";
$sql="SELECT workshopID, workshopName
FROM workshop
WHERE orgID='$orgID'";
$result = mysql($dbName, $sql);
while($row=mysql_fetch_row($result)){
$workshopID=$row[0];
$workshopName=$row[1];
$i=0;
print"<input type=\"checkbox\" name=\"workshop[$countWorkshopCheck]\" value=\"workshopID\" ";
while($i<$s){
if($workItems[$i]==$workshopID){
print" checked";
$workshopArray[]=$workshopID;
}
$i++;
}
print">$workshopName<br>";
$countWorkshopCheck++;
}
Thanks for your time! Any help would be greatly appreciated.