sy ada problem utk delete record menggunakan href
setiap record, sy letakkan checkbox.
ble user nk delete record dia akan check record yg nk di delete.
then user akn clik href yg ada link utk ke delete.php page
kat page tu ada code delete.
tp sy nye code delete record yg last jer..
xikut checkbox yg user clik..
sy dapat delete bila menggunakan button,tp
masalahnye bos sy nk gunakn href..
harap dpt tolong..
code checkbox
<input name="checkbox" type="checkbox" id="checkbox[]" value=" <?php echo $checkbox_id;?> " />
ini utk link ke delete.php
<a href="delete.php?action=delete&prj=<?php echo $prj_id; ?>">Delete</a>
ini utk php code delete mengikut value checkbox.
<?php
if($action=="delete"){
$checkbox = $_GET['checkbox']; //from name="checkbox[]"
$countCheck = count($_GET['checkbox']);
for($i=0;$i<$countCheck;$i++){
$del_id = $checkbox[$i];
$sql = "delete from project_info where prj_id = $del_id";
$r= $c->Execute($sql);
}
}
?>