这是我的deleteriddle.php,但它不起作用。请帮帮我
<?php
require("dbcon.php");
$ridid = isset ($_GET['riddleid'])?$_GET['riddleid']:"";
$query = sprintf("DELETE FROM riddle WHERE riddleid= '$ridid'");
$result = mysql_query($query);
if (!$result) {
die('Invalid query: ' . mysql_error());
}
else {
echo '<script type="text/javascript">
alert("Riddle successfully delete");
window.location.href = "viewriddle.php";
</script>';
}
mysql_close($dbcon);
?>
答案 0 :(得分:0)
试试这个:
$query = sprintf("DELETE FROM riddle WHERE riddleid= %u", $ridid);