I have a question about how can I delete the desired number from the img_ids
. As you see in the table below the img_ids
like 68,67,66,65,64,
. I want to delete for example number 67
, how can I do that with PHP. My mind is confused because of the commas :S.
<div class="delete" id="67">Delete Image</div>
Ajax
$("body").on("click", ".delete", function(){
var deleteimgid = $(this).attr("id");
var data = 'img='+deleteimgid;
$.ajax({
type: 'POST',
url: 'delete.php',
data: data,
cache: false,
beforeSend: function(){},
success: function(response){
}
});
});
delete.php
<?php
include_once 'inc.php';
if(isset($_POST['img'])){
$imgid = mysqli_real_escape_string($db, $imgid);
// Then what should be the query ?
// I am confused because of the commas.
}
?>