Saving values from check boxes into data base.
Posted: Thu Jan 22, 2004 1:15 am
I am having problems saving all the boxes checked into my data base. I am pulling a list of check box values from a data base, then trying to get the boxes that are checked put back into a different table. I am able to get the form to add the last one checked, but I can't get multiple entries. I have never been very good at getting info into arrays. I assume that's what I need to do, is get all the values from the checked boxes into an array, then do a foreach and add them to a table.
Here's what I have so far. It isn't much.
Here's what I have so far. It isn't much.
What do I need to get all the group_values?while($row = mysql_fetch_array($result)){
$value_id=$row["value_id"];
$value_name= $row["value_name"];
echo"<input type=\"checkbox\" value=\"$value_name\" name=\"group_value\">$value_name";
}
$query = "INSERT INTO ".$prefix."store_options_".$group." set value='$group_value'";
$result = mysql_query($query) or die("Error: " . mysql_error());