mysql - Trouble with SQL statements - querying databases with PHP -


I am trying to write some code that will connect to a database called 'user' and 'password' fields. I have been writing this PHP yet:

  $ passw = $ _POST ['pass']; $ User = $ _POST ['user']; $ Users_password_db = "user select password" user 'WHERE user name = $ user'; $ Result = $ mysqli- & gt; Query ($ users_password_db); If ($ passw! = $ Result) {$ errors [] = "Wrong username or password, please try again or contact the administrator for support."; } And {header ('location: /dashboard.php'); }  

However, every time I log in with my correct username and password, it says that the password is wrong. I do not think this is a connection error, because I can properly add data to the database.

I'm just starting with SQL, so sorry it's a clear question.

Ensure that the username and password variables are correctly named in both their php code and databases. is. The issue of capitalization!


Comments