我想在删除多行之前给出确认消息。下面是代码。请建议我在删除记录之前如何提供确认信息。
$sql="SELECT * FROM employee";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
?>
<?php
while($rows=mysql_fetch_array($result)){
?>
<tr>
<td><input name="checkbox[]" type="checkbox" id="checkbox[]" value="<? echo $rows['id']; ?>"></td>
<td><? echo $rows['id']; ?></td>
<td><? echo $rows['name']; ?></td>
</tr>
<?php
}
?>
<tr>
<td><input name="delete" type="submit" id="delete" value="Delete"></td>
</tr>
<?php
if($delete){
for($i=0;$i<$count;$i++){
$del_id = $checkbox[$i];
$sql = "DELETE FROM employee WHERE id='$del_id'";
$result = mysql_query($sql);
}
if($result){
echo "<meta http-equiv=\"refresh\" content=\"0;URL=delete_multiple.php\">";
}
}
?>