Instead of letting PHP determine which index to give it, tell it which index to use by assigning the zone number to the check variable.
For instance (this is the form page):
<?php
// DB connect code goes here
$result = @("SELECT * from assign");
While($row = @mysql_fetch_array($result)): ?>
<td><input type='Checkbox' name='check[<?=$n1?>]'></td>
<input type='text' size='10' name='date[<?=$n1?>]'></td>
<?php endwhile; ?>
Notice the hidden tag is missing? It is not needed if you assign the $n1 variable to the checkbox itself. I'm assuming $n1 is the autonumber field, or some other unique numbered DB field...
On the target page:
While(List($key,)=each($check)) {
echo "$check[$key]<br>";
echo "$date[$key]<br>";
$sql = "update assign set truck_no = '', driver = '', date_last_visited = '$date[$key]', current_status = 'off' where zone = '$key'";
}
That should do it.... With this code, it will only parse the ones that were checked (as yours did), but this time it knows which index to apply to the database since you set it explicitly. $key is equal to the currently set index of the array, so if you were to check 1, 3 and 4, you would get keys of 1, 3 and 4 (or whatever $n1 holds for each entry) instead of 0, 1 and 2 as you did before.
Let me know if you have any problems. 😉
John Cornett