Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Try out my first PHP web app! Reply To: Try out my first PHP web app!

#177587
__
Participant

Basically, yes. However:

  • don’t use select *. Specify the fields you want explicitly.
  • don’t use a loop. There should only be one row in a successful result, so there is no need: it just complicates things.
select hash from users where username=?
// do your query  . . .

// assuming you get a result, verify:
if( password_verify( $_POST['password'],$queryResult['hash'] ) ){
    //  valid
}else{
    //  invalid
}