I have a code that i want to throw an error if there is no items to delete or if there is items it proceeds with deleting the items, here is what i have so far:
if (isset($_REQUEST['removeall'])){
if($_REQUEST['removeall'] == 1){
mysqli_query($mysqli,"DELETE FROM assets WHERE cust_id = $custID AND del_flag = 1 ");
if(mysqli_query < 1){
$result = '<div class="alert alert-warning alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>No assets to delete</div>';
}
$result = '<div class="alert alert-success alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>All Assets Deleted</div>';
}
}
Am i on the right track? Everytime i request it, it just says All Assets Deleted even though there are no assets flagged.