为什么其他消息不显示

这是我正在使用的php代码的结尾,您能否让我知道为什么我没有收到after else消息。

    if ($desc !="")
      {
    $sql = "INSERT INTO categories (name, description,image,videolink,videoimage,user,date)
                VALUES ('$name', '$desc', '$exitfile','$videolink','$exitfile1','$use','$date')";
      }
      else {
     $sql = "INSERT INTO categories (name,image,videolink,videoimage,user,date)
            VALUES ('$name',  '$exitfile','$videolink','$exitfile1','$use','$date')";
                }


    if ($db->query($sql) === TRUE) {                    
    echo "<p align='center'><font color='green'><b>New image added successfully</b> </font></p>";               
    echo "<script>window.location.href='categoryadd1.php';</script>";
    header('Location:categoryadd1.php?message=Category added successfully');
    } 


  else 

  {

  echo "Error: " . $sql . "<br>" . $conn->error;
评论