Home › Forums › Back End › Deleting multiple rows in MySQL database using ajax and php › Re: Deleting multiple rows in MySQL database using ajax and php
March 9, 2013 at 12:22 pm
#127604
Member
NEVERMIND!!! I just had to create an array and pass it to my delete.php file.
$(‘#post_list’).submit( function (e) {
e.preventDefault();
var postID = [];
$(“.select_post[name=’select_post[]’]:checked”).each(function () {
postID.push(parseInt($(this).val()));
});
alert(postID);
$.ajax({
type: ‘POST’,
url: ‘delete_post.php’,
data: { select_post : postID }
}).success( function () {
alert(‘deleted’);
});
});
Thanks to myself :P