I am trying to understand why this SQL statement is not working once I run the script.
If i make the query manually in phpMyadmin, it returns the correct result; but once the script runs with the same query in it, the query is returning nothing.
This is my query:
btw: $heute is this:
$date_array = getdate();
$heute = $date_array[mday]."/".$date_array[mon]."/".$date_array[year];
$sql = "SELECT email, was, wo, entfernung FROM jobsperemail WHERE haufigkeit='1' AND WHERE bestatigt='ja' AND last_sent!='$heute'";
This is my DB schema:

And these are the table values:

Can someone please help me?
You have a syntax error in your SQL query:
You’ll need to remove the second
WHEREkeyword, as such: