View Single Post
Old 03-12-2008, 09:27 AM   #6 (permalink)
oMIKEo
The Contributor
 
oMIKEo's Avatar
 
Join Date: Jan 2008
Location: Leeds
Posts: 52
Thanks: 7
oMIKEo is on a distinguished road
Default

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
Send a message via MSN to oMIKEo
oMIKEo is offline  
Reply With Quote