If you are going to use karuppasamy's example, I would make sure you add some protection, check that the values passed are actually numbers. Otherwise you may find that your database is open to attack.
Also, JavaScript is overkill here, no point using it when the same can be acheived simply using HTML and PHP.
1. Make sure all the checkboxes have the same value for name and add [] to indicate it is an array to PHP and set the value to the id of the database row. e.g.
<input type="checkbox" name="foo[]" value="1">
<input type="checkbox" name="foo[]" value="2">
2. In PHP add something along the line of a foreach to see if the box was checked, something like:
foreach($_REQUEST['foo'] as $checkboxVal) {
// Check the value is a number
if(is_int($checkboxVal)) $tmpDeleteRecords .= $checkboxVal . ", ";
}
// Remove the last 2 characters (space and ,)
$deleteRecords = $substr_replace($tmpDeleteRecords,"",-2)
You can then use the returned $deleteRecords in your SQL query to. Although the code above is untested and from memory, so you will need to review before using.