Dear Experts,
I have designed an Intranet DB using PHP and MySQL. The target of the DB is to manage trainees. The Status of the students w/r they attend the course or not is blank because all the registered students might not attend the training.
file1.php
while($rec = mysql_fetch_object($result))
{
echo"<tr align = center><td><b>$count</td><td><b>$rec->TraineeName</td><td><b>$rec->CustomerName</td><td><b>$rec->Telephone</td>
<td><b>$rec->Payment</td>
<form action = file2.php method = post>
<td><input type = checkbox name = 'st' value = 'OK'></td>
<input type = hidden name=sdate value = '$sdate'>
<input type = hidden name=edate value = '$edate'>
<input type = hidden name=CourseCode value = '$CourseCode'>
</tr>";
$count++;
}
?>
<tr align = center bgcolor = white><td colspan =7><input type = submit value ="Update the Status of the Course"></td></tr></form>
<tr align = center bgcolor = white><td colspan =7><marquee><font color = red><b>Note that P stands for PAID and NP stands for NOT PAID</td></tr>
<?
}
}
?>
file2.php
$edate = $HTTP_POST_VARS['edate'];
$sdate = $HTTP_POST_VARS['sdate'];
$CourseCode = $HTTP_POST_VARS['CourseCode'];
$st = $HTTP_POST_VARS['st'];
$connection = mysql_connect ("localhost", "root", "Samira");
$database = mysql_select_db("customer");
$query = "update takescourse set Status = '$st' where CourseCode = '$CourseCode' and StartingDate='$sdate' and EndingDate='$edate'";
$result = mysql_query($query);
?>
Now, the problem is when I select the check box and Submit, the status of all the trainees registered for that course will be changed to OK. (I wan the status of the participants who attended the course to be OK)
Your HELP will be appreciated!,
Solomon