从ID中删除SQL行

时间:2013-07-04 20:42:57

标签: php delete-row

此语法对我不起作用。我正在发布一个来自html脚本的变量,当echo'ed它将打印数字。

但是,当我尝试通过SQL删除它时,它将无法正常工作。

<?php
$idholder = $_POST['delete_id'];
$con=mysqli_connect("hostaddress","username","pw","db");
// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
mysqli_query($con,"DELETE FROM SWANK_support WHERE order='$idholder'");
mysqli_close($con);

header ("location: /support.php");
?>

0 个答案:

没有答案