Checkboxes
| From: | Phpu | Date: | Tue, 27 Apr 2004 12:43:13 +0000 |
| Subject: | Checkboxes | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-184754@lists.php.net to get a copy of this message | ||
I have this script:
Each brand has more that one model. When i chose a brand it displays chackboxes for each model in a
form..
Now i want to select some models and introduce them into database.
How can i do that. This script display the each model, but wen i chose some of them the form
doesn't work. .
<FORM METHOD=POST ACTION="add_prodrel.php" enctype="multipart/form-data"
NAME="doublecombo">
<?
$query12 = "SELECT id, brand_id, model_id FROM shop_items WHERE
id='$showdetail'";
$result12 = mysql_query($query12) or die("error in query - $query12 -
".mysql_error());
while($row = mysql_fetch_row($result12)) {
list($id, $brand_id, $model_id) = $row;
$query3 = "SELECT id, brand_id, name FROM shop_models WHERE
brand_id='$brand_id'";
$result3 = mysql_query($query3) or die("error in query - $query3 -
".mysql_error());
while($row = mysql_fetch_row($result3)) {
list($id, $brand_id, $name) = $row;
echo " <input
type='checkbox' name='".$name."'
value='".$id."'> $name<br>";
}
}
?>
<INPUT TYPE="hidden" name="add" value="set"><INPUT
TYPE="submit" name="submit" value="Ajouter">
</form>