如果数据库表为空,则阻止显示删除按钮? [关闭]

How can I hide the delete button with this array if $count > 0. Is there a way inside the PHP code to do this? Can someone help? I'm also open for anyone who wants to revise the code to be more secure.

<form action="checkbox.php" method="post">

<?php
$query = "SELECT filmTitle, filmRole, filmDirector, idfilm FROM filmInfo, actorsInfo
WHERE (actorsInfo.id = filmInfo.id_actor) AND email = '$_SESSION[email]'";

$result = mysql_query($query);
$count=mysql_numrows($result);

if($count > 0){
echo "<table>";

echo "<table border='1' style='border-collapse: collapse;border-color: silver;'>";   
echo "<tr style='font-weight: bold;'>";   
echo "
    <td width='20' align='center'>#</td>
    <td width='200' align='center'>TITLE</td>
    <td width='200' align='center'>ROLE</td>
    <td width='200' align='center'>DIRECTOR</td>"; 
echo "</tr>";

$row_number = 1;
while ($row = mysql_fetch_array($result)) {

  $id_actor= $row["id_actor"];
  $idfilm= $row["idfilm"]; 
  $filmTitle= $row["filmTitle"];
  $filmRole= $row["filmRole"];
  $filmDirector= $row["filmDirector"];


  echo"<tr>";
  echo '<td><input name="checkbox[]" value="'.$idfilm.'" type="checkbox" 
    id="checkbox'.$row_number.'" /></td>';


  for ($i=0; $i<3; $i++)  {
   echo"<td> $row[$i]</td>";
  }
  echo"</tr>";

  $row_number++;
  }
  echo"</table>";
  }

  ?>

  <input type="submit" name="deletefilm" value="Delete" />
  </form>
if($count > 0){

    echo "<table>";

    echo "<table border='1' style='border-collapse: collapse;border-color: silver;'>";   
    echo "<tr style='font-weight: bold;'>";   
    echo    "

    <td width='20' align='center'>#</td>

    <td width='200' align='center'>TITLE</td>
    <td width='200' align='center'>ROLE</td>
    <td width='200' align='center'>DIRECTOR</td>"; 
    echo "</tr>";

    $row_number = 1;
    while ($row = mysql_fetch_array($result)) {

    $id_actor= $row["id_actor"];
    $idfilm= $row["idfilm"]; 
    $filmTitle= $row["filmTitle"];
    $filmRole= $row["filmRole"];
    $filmDirector= $row["filmDirector"];


    echo"<tr>";
    echo '<td><input name="checkbox[]" value="'.$idfilm.'" type="checkbox" 
    id="checkbox'.$row_number.'" /></td>';


    for ($i=0; $i<3; $i++)  {
       echo"<td> $row[$i]</td>";
    }
    echo"</tr>";

    $row_number++;
    }
    echo"</table>";
}