i have a piece of code that pulls out members first and last names out of a 'members' database and displays each name, with a select box infront of to the name.
The select box has three options: fire scene, drill scene, and station. the user selects either one of the three options, or nothing for each member.
The 'members' db keeps track of the total number calls a member made, how many of them were 'fire scene', how many were 'drill scene' and how many were 'station'.
Now, i need to collect the members names and which option was choosen for each member, unless nothing was chossen for a member, that member is to be ignored.
Then update the 'members' database by adding 1 to either fire scene, drill scene, or station for each member that participated in the call.
how can I send the right data to the the validation script to update the members database??
Below is the piece of code i use to get the members names...
i can't figure out how to send the varables to the validation script.
<?php // Format Names into a nice table
$result = mysql_query($query);
if (($result = @ mysql_query ($query, $connection))){
while ($row = mysql_fetch_array($result)){
echo " <table width=\"25%\" border=\"1\" bordercolor=\"#FFFFFF\">
<tr>
<td width=\"30%\"><font size=\"2\" face=\"Tahoma\">
<select name=\"$row['members'];\">
<option>-----------</option>
<option name=\"$row['fire']\" >Fire Scene</option>
<option name=\"$row['drill']\" >Drill Scene</option>
<option name=\"$row['station']\" >Station</option>
</select></td>
<td width=\"75%\"><font size=\"2\" face=\"Tahoma\">
" .$row['lastname'] . ", " . $row['firstname'] . "</td>";
}
echo "</tr></table>";
}
else
showerror(); ?>
This is not the only data i am sending to the validation script. i am sending a bunch of other data to the validation script that is entered into another database called 'call_info'.
this is how i retrieve the variables on the validation script from the <form>.
// Set up a $usrVars array
if (!session_is_registered("usrVars"))
session_register("usrVars");
foreach($_POST as $varname => $value)
$usrVars[$varname] = trim(clean($value, 50));
$_SESSION["usrVars"] = $usrVars;
how do i retrieve data for each of the members??
i hope what i am asking is clear.. if it's not just ask me...
thanks alot for any help!