So I have a form that is being submitted to a PHP file. The form contains 2 values ($username & $password) and I would like to compare those values to a MySQL table. First, check if the "username" column has that exact value that $username has (match case and value) and if it does contain it, check the "password" column of that row if it contains the exact value of $password (match case and value). Here's what I am talking about...
PHP Values:
$username = "Billy Bob";
$password = "abc123";
MySQL Table:
id | username | password
1 | billY boB | 123aBc
2 | Billy Bob | abc123
If the username and password matches the column's value, then I want it to return true
or false
. I'm using PHP's new mysqli()
. Can this be done, and if so, what is the query? I am very new to MySQL, so I don't know much.