我已经编写了从 MYSQL 数据库中删除一行的语法。这工作正常但是我现在将它移动到另一个页面(复制和粘贴)并且由于某种原因它不能在新页面上工作
我不确定如何添加错误报告,所以只需获取server error
这是代码
<?php
$prodID = $_GET["q"];
if ($prodID <= "0") {
echo("
<h3>This Product Does Not Exist</h2>
<table border='0'>
<tr>
<td>
<a href=catalogue.html'><button class='btn btn-info'><font color='white'> Add A New product </font></a></button>
</td>
<td>
<a href='manageproducts.php'><button class='btn btn-info'><font color='white'>Back to Products</font> </a>
</td>
</tr>
</table>
");
} else {
$con = mysql_connect("localhost", "cl49-xxx", "xxx");
if (!$con) {
die('Could not connect: ' . mysql_error());
}
@mysql_select_db("cl49-XXX", $con) or die("Unable to select database");
$result = mysql_query("DELETE FROM products WHERE prodID=$prodID") or die(mysql_error());
?>