getting number of rows deleted.?
i want after delete g开发者_开发百科etting number of rows deleted (How many of rows are deleted?). how is it?
In your PHP code, you can retrieve the number of rows that were deleted by calling the mysql_affected_rows() function and then return that value back to your Javascript.
Your PHP code might look similar to this:
...
$query = "DELETE FROM myTable WHERE some_column=something";
mysql_query($query);
$number_of_rows_deleted = mysql_affected_rows();
return $number_of_rows_deleted;
...
MAYBE you can count the checked checkboxes, on your JavaScript:
var total = $(':checkbox:checked', '.ser_form').size();
alert(total + ' rows deleted');
This way you're not counting the deleted rows from the database, only the count of checked checkboxes.
精彩评论