我试图计算有 0 行的行,但是当没有与 SQL 查询匹配的行时,它仍然返回 1 行。有谁知道我做错了什么?
$del = mysql_real_escape_string(strip_tags($_GET['del']));
if ($del)
{
$sql6 = "SELECT count(*) FROM oneliners WHERE id='$del' AND to_user='".$_SESSION['username']."'";
$result6 = mysql_query($sql6) or trigger_error(mysql_error()."".$sql6);
$num_rows6 = mysql_num_rows($result6);
echo $sql6;
echo '<br>';
echo $num_rows6;
//If no rows return, do this
if ($num_rows6 <= 0)
{
header("location:oneliner.php");
exit();
}