I am a beginner in php, and maybe the problem is so simple, but when i try to get the hash from my db, and let the password verify do all the work, its always give me false, even with the correct password. I tried to copy paste the hash from the db and put it inside the password verify, and it worked.
$sql="SELECT * FROM users WHERE username='$myusername'";
$result=mysqli_query($connection,$sql);
// Mysql_num_row is counting table row
$count=mysqli_num_rows($result);
// If result matched $myusername, table row must be 1 row
if($count==1){
//This must be the problematic place
$hash = mysqli_query($connection,"SELECT jelszo FROM users WHERE username =='$myusername'");
if(password_verify($myjelszo,$hash))
{
// Register $myusername, $myjelszo and redirect to file "login_success.php"
$_SESSION['username']= "myusername";
$_SESSION['jelszo']= "myjelszo";
header("location:login_success.php");
}
else {
echo "Wrong Username or Password";
}