Hi guys i dont know what im doing wrong but my tables are correct, php error is on and it doesnt insert

I can get both first name and email echoed
 <?php 
 if (isset($_POST['subs'])) {
 function html_escape($html_escape) {
    $html_escape =  htmlspecialchars($html_escape, ENT_QUOTES | ENT_HTML5, 'UTF-8');
    return $html_escape;
    }   
    $name=html_escape($_POST['name']); 
    $email=html_escape($_POST['email']);
   if (empty($name) || empty($email)) {echo"<div class='alert alert-danger'>Please enter both name and email address</div>";}
   else {
    if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
   echo"<div class='alert alert-danger'>Invalid email address, please enter a correct email address!</div>";
    }
        else {
 echo "INSERT into subs (first_name, email) VALUES ('$name','$email')";
 $insert=mysql_query("INSERT into subs (first_name, email) VALUES ('$name','$email')");
  if ($insert) {echo"<div class='alert alert-success'>Thank you for subscribing with us</div>";}
     }
 }}
 ?>
 
     
    