How to to chek user email and phone Already In database email & phone validation

<?php

$connect = mysqli_connect("localhost","root","", "connect_my");
   
    if(isset($_POST['send'])){
        $name = $_POST['name'];
        $email = $_POST['email'];
        $phone = $_POST['phone'];
        $dept = $_POST['dept'];



        $email_select = "SELECT * FROM insert_data WHERE email = '$email'";

    

        $exc = mysqli_query($connect, $email_select);
        $count =mysqli_num_rows($exc);
        
if($count>0){
    echo "<script>alert('Email Already In') </script>"."<script>alert('phone Already In') </script>";
}

else{
    $query =  "INSERT INTO insert_data (name,email,phone,dept)
    VALUES ('$name','$email','$phone','$dept')";
   $insert = mysqli_query( $connect ,$query );

   if($insert){
     echo "<script>alert('data send success')</script>";
   }
   else{
       echo "<script>alert('data send failed')</script>";
   }
}




      
    }
?>`Preformatted text`