03-12-2008, 09:27 AM
|
#6 (permalink)
|
|
The Contributor
Join Date: Jan 2008
Location: Leeds
Posts: 52
Thanks: 7
|
ok i'm running into a little problem...
I have set all of the check boxes to:
PHP Code:
<input type="checkbox" name="checkbox[]" value="id[]" />
and have this code:
PHP Code:
for ($i = 0; $i < count($_POST['checkbox']); $i++) {
//echo "myAction: $myAction<br />i: $i<br />";
mysql_query('UPDATE orders SET '.$myAction.' = "Y" WHERE id = "'.$_POST['id'][$i].'" LIMIT 1');
}
in that loop it's saying where id = i but i need i to be the id number of that record but it hasnt been set anywhere, should i do:
PHP Code:
<input type="checkbox" name="checkbox[]" value="id[<?php echo $id; ?>]" />
or something like that?
Thanks
|
|
|