11-25-2016, 03:31 PM
So, in that situation, you are already getting the id on every row (even if you don't want to show it).
I tend to like to redirect people to a different page if they're deleting so you can put as many confirmations and checks as you want in there, so you would add a row like this to the table...
<td>Delete this Item</td>
Then the delete_item.php page would pull in the id...
Then you do whatever confirmations you want to do to make sure they're sure and delete the item....
$db->delete('items',array('id','=',$itemID));
The format is
('tablename', and then an array with the 'columname', 'your operator, usually equals, but could be anything', $variable).
I tend to like to redirect people to a different page if they're deleting so you can put as many confirmations and checks as you want in there, so you would add a row like this to the table...
<td>Delete this Item</td>
Then the delete_item.php page would pull in the id...
Code:
$itemID = Input::get('id');
Then you do whatever confirmations you want to do to make sure they're sure and delete the item....
$db->delete('items',array('id','=',$itemID));
The format is
('tablename', and then an array with the 'columname', 'your operator, usually equals, but could be anything', $variable).