radio groups in loop form
| From: | Peter Houchin | Date: | Wed, 11 Apr 2001 05:30:01 +0000 |
| Subject: | radio groups in loop form | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-48119@lists.php.net to get a copy of this message | ||
hiya,
I have a radio button in a loop with the rest of the form, how ever when i go to do the mutliple
update it clears all but the updated radio buttons(rest of form data is fine just the update on
radio buttons) could some one pls give me an idea why, when every thing else works propperly with
the script
heres the code (only concerning the radio buttons)
<?
if ($submit) {
//echo "Values submitted via POST method:<br>";
reset ($HTTP_POST_VARS);
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
//echo "$key => $val<br>";
}
reset($id);
while (list ($key, $val) = each ($id)) {
//echo "Key: $key => Value: $val;<br>";
rs="update...
rs .= "quote='".$quote[$key]."',";
..
rs .= WHERE id='$id[$key];
$result = mysql_query($rs,$db);
print mysql_error($db);
}
}
?>
rest of form
<input type="radio" name="avail[]" value="y" <? if ($avail ==
'y') { echo 'CHECKED'; }?>> // repeated line with 'n' &
'pending' instead of 'y'
Peter Houchin
peterh@sunrentals.com.au
=========================================================
_____ __ /\
/_/_/_\ / |_/ \
/_/_/_ __ __ __ __ / \
\_/_/_\ /_/ /_/ /_/ /_/ \ _ /
___\_\_\/ /_/_/_/ /_//\/_/ \_/ \/\_/
\_//_/_/ /_/_/_/ /_/ \/_/ v
________ ________________________________________
/_/_/_/_/ /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
/_/_ _/_/ ______ __ __ /_/ ____ __ ______
/_/_/_/_/ /_/_/_/ /_/ /_/ /_/ /_/\_\ /_/ /_/_/_/
/_/ \_\ /_/ _/ /_//\/_/ /_/ /_/__\_\ /_/___ _\_\_\
/_/ \_\/_/_/_/ /_/ \/_/ /_/ /_/ \_\/_/_/_//_/_/_/
=========================================================
Telephone : (03) 9329 1455 Facsimile : (03) 9329 6755
************* We rent the dot in .COM! **************