I want to update a bunch of records at once. Basically I have a website where subjects are assigned to researchers for a psychological study. Once the subject has completed the study, the researcher logs in to indicate which subjects have participated and which ones have not. One researcher has as many as 800 subjects.
Each record (subject) has a radio button named using an array notation....participated[SubjectUIN] with values of yes or no with no checked as the default value.
Here is that part of the code:
_<input type=\"radio\" name=\"participated[SubjectUIN]\" value=\"Yes\"";
_ if($subjects_row[Participated]=="Yes") {
_ _echo("checked");
_}
_echo " /> Yes
_ _ _ _
_<input type=\"radio\" name=\"participated[SubjectUIN]\" value=\"No\" ";
_ if($subjects_row[Participated]=="No") {
_ _echo("checked");
_}
_echo " /> No
If the researchers click on Yes for a particular subject, how can I add that response to the "participated" array.
Basically, on the following page I want to be able to update the database using this array. For example:
foreach ($_POST['participated'] AS $subjectUIN => $participated)
__mysql_query("UPDATE subjects SET Participated='$participated' WHERE SubjectUIN='$subjectUIN'") or die(mysql_error(