Hey,
I've listed all my results from a database and then i can edit these and click save, I want to be able to update all results
IE:
I have the key, $result_id and under this I have two text boxes, box1 and box2. My display code just loops showing the two boxes, then a can click save.
How do I write the code to update all the boxes under each key field $result_id?
I was thinking maybe something like this
$i = 1;
$result2 = mysql_query ("SELECT * From results_data where comp_run_id = $comp_run_id and group_id = $group_id");
while($row2 = mysql_fetch_array($result2)) {
$result_id = $row2["result_id"];
$result3 = MYSQL_QUERY("update results_data set team1_id = '$team1_id[$i]', team2_id = '$team2_id[$i]' where result_id = $result_id");
$i++;
}
Okay this code works fine but how do I make the $team1_id and $team2_id have the value of $i next to it each time it does the loop???