Im trying to count the rows where there are 0 rows, but it return 1 row anyways, when there are no rows that matches the SQL query. Does anyone know what im doing wrong?
$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();
}