Q:

Check if data sent matches a row

I am wondering how to check if a row matches something in another row. Ex. if the database looks like this:
USERNAME   PASSWORD       EMAIL
Xp10d3     passwordlol    hello@gmail.com
Blurber    password2lol   hello@gmail.com

I want to check if the user submitted the username "Xp10d3" and check if the password was passwordlol and the email submitted was myemail@gmail.com. But I can't just check each individual item since there could be two of the same emails under different usernames (as shown above). So how would I check if the data sent matches a row? I have already Googled this and checked this STO: Check if match 3 or more match in DB row
But that didn't seem to work for me. It said it couldn't find the username/password even though it was already in the database.
Current code I have:
<?php
    /* Sends an email to the user and adds the special key to another database */
    $username = $_GET['username']; /* Gets the username that was submitted in the HTML form. */
    $password = $_GET['password']; /* Gets the password that was submitted in the HTML form. */
    $servername = "localhost"; /* MySQL database. Change if needed! Most of the time its not localhost unless you're hosting on your computer. */
    $user = 'usernamelol'; /* MySQL username. Change if needed. */
    $pass = 'passwordlol'; /* MySQL password. Change if needed. */
    $dbname = 'vibemcform'; /* MySQL database name. Change if needed. */

    $bytes = random_bytes(10); /* Randomized code */
    $key = bin2hex($bytes); /* Makes the randomized code */

    $con = new mysqli($servername, $user, $pass, $dbname); /* Connects to the database */
    $query = mysqli_query($con, "SELECT CASE WHEN USERNAME = $username AND PASSWORD = $password THEN 'TRUE ' 
               ELSE 'FALSE' END FROM data");
    /*
    if (mysqli_num_rows($username_query) > 0) {
            echo "Found username!";
    } else {
        echo "Couldn't find that  username!"
        $con -> close();
        exit;
    }
    */
    if ($query === true) {
        echo "Found data in the database!";
    } else {
        echo "Username not found/password incorrect. Please try again!";
    }

    $conn = null;
    echo 'Username submitted: ' . $username . ' Password submitted: ' . $password . ' .'; exit;
?>

A:

$query = mysqli_query($con, "SELECT * FROM users WHERE (BINARY username='$string' OR BINARY email='$string') AND BINARY password='$password'");

if(mysqli_num_rows($query) == 1){
    $userCredentialsChecked = TRUE;
}

