将mysql代码转换为mysqli

I'm very new to programming with PHP and MySQL and all of these are just new to me and I can't seem to grasp some of it. I was trying to learn how to disable users from entering duplicate data into a database and the sample code that I'm working with is mysql but my project is using mysqli. Can someone help me convert this code into mysqli? Your help would be greatly appreciated thank you!

if (isset($_POST['first_name']) && isset($_POST['last_name']) && isset($_POST['email'])) {
        $f_name=$_POST['first_name'];
        $l_name=$_POST['last_name'];
        $email=$_POST['email'];

        $usercheck=$email;
        $usercheck="SELECT * FROM students WHERE email = '$usercheck'";
        $result=mysql_query($usercheck,$dbc);
        $yes=count($result);
        echo $yes;

What about this?

    <?php

        if (isset($_POST['first_name']) && isset($_POST['last_name']) && isset($_POST['email'])) {
            $f_name=$_POST['first_name'];
            $l_name=$_POST['last_name'];

            $sanatize_email=filter_var($_POST['email'], FILTER_SANITIZE_EMAIL);   

            $stmt = $conn->prepare("SELECT * FROM students WHERE email = ?");
            $stmt->bind_param("s", $sanatize_email);
            $stmt->execute()
            $row = $stmt->fetch(PDO::FETCH_ASSOC);
            if( ! $row)
            {
                die('nothing found');
            }
        }

Note that $conn is included from your database connection file and needs to now be a sqli connection string instead of just an old slq connection string. Something like this:

$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}