In my code I have a bunch of if-clauses that check wether a user given input is valid to be inserted in to the database. Now there's one little if clause, which I want to check wether the userinput is the same as a given string from the database. I've been trying for a day now what my mistake is and I just can't seem to find a solution.
$car = $_POST['car'];
$exists = mysqli_query("SELECT car FROM box WHERE car = '".$car."' AND del = 0;");
if($car == $exists) { //same string, give error1 } else { give error2 }
I have no clue what the problem could be as '==' is supposed to be case sensitive and as far as I was able to find out you can compare strings in variables like this.