to delete 14 row by 1 click

You should have a hyperlink for delete action.

<a href="<?php echo $row->id;?>">
Delete Record

Here it appends record ID in url and it looks like delete.php?id=15

Now you want to delete previous 14 records.

$currentId = $_GET['id'];//got from URL
$nextLimit = $currentId - 14; //in case of next 14 you need to add

Your SQL Query should be:

$query = "delete from table
          where id between '$currentId' and '$nextLimit'";

and execute the query.

Browse More Popular Posts

Leave a Comment