HI
i am try to delete multiple data by using check-box in php
i tried but is don't works not getting the ids from the check-box..
my code is
<tbody>
<?php while ($row = mysql_fetch_array($res)) { ?>
<tr class=" <?php echo $class = ($class == 'even') ? 'odd' : 'even'; ?>" >
<td><input type="checkbox" name="checkbox[]" value="<?php echo $row['grievance_id']; ?>"/></td>
<td><?php echo $row['grievance_id']; ?></td>
<td><?php echo $row['grievance_reason']; ?></td>
<td align="center"><?php echo $row['grievance_meeting']; ?></td>
<td align="center"><?php echo $row['next_review']; ?></td>
<td align="center"><?php if($row['matter_resolved'] == 1)
{ echo "Yes"; }else{ echo "No"; } ?>
</td>
</tr>
<?php } } ?>
</tbody>
</table>
</form>
<?php
if(isset($_POST['action']) == "gdelete")
{
$checkbox = isset($_REQUEST['checkbox']);
$countaa = count($checkbox);
for($i=0;$i<$countaa;$i++){
echo $del_id = $checkbox[$i];
echo $sql = "DELETE FROM hs_hr_emp_grievances WHERE grievance_id=$del_id";
$result = mysql_query($sql);
}
}
?>