Mysql Query not returning my results when adding variables into the query

QuestionsMysql Query not returning my results when adding variables into the query
sethbeckerman5 Staff asked 9 years ago

If I run this with the query

It returns my result. But as soon as I run this

it doesn't.
If I run it in Mysql workbench without the variables it works. If I run echo the $_POST values they come through correctly.
I am stumped as to what I'm doing wrong PLEASE!! help me.
I also ran my code through https://phpcodechecker.com/ and it cant see any errors in my code.
This is the full function.

Every time it says "Invalid Login Details!" But I know their is one result that gets returned.
What am I doing wrong?

Inserting variables into your SQL directly is a major source of SQL Injection Attacks. Use PDO for security.
https://www.php.net/manual/en/book.pdo.php#114974


View on Stack Overflow