0
<?php
require('db.php');
$itemid=$_REQUEST['itemid'];
$query = "DELETE FROM lfmstable WHERE itemid=$itemid"; 
$result = mysqli_query($con,$query) or die ( mysqli_connect_error());
header("Location: tables.php"); 
?>

I'm new to php and I can't seem to make the "Delete" button from my table work. I don't know what is the problem.

paeng
  • 11
  • Can you share the code of portion from where you are sending this `itemid`...if you are trying to delete your item like `url/ifms/deletei.php?itemid=1` then try to use `$_GET['itemid']` – coderman401 Feb 02 '20 at 09:48
  • query("DELETE FROM `lfmstable` WHERE `itemid` = '$_REQUEST[itemid]'") or die(mysqli_error()); header('location: tables.php'); I changed my code to this and now whenever i click the delete button, it doesn't do anything – paeng Feb 02 '20 at 09:58

0 Answers0