In my PHP code the following warnings appear:
Warning: mysqli_query () expects parameter 2 to be string, object given in on line 8
Warning: mysqli_num_rows () expects parameter 1 to be mysqli_result, null given in on line 9
I honestly do not understand what this means in practice, what is Parameter 2? I do not quite understand when these warnigns appear to me.
Follow the PHP code:
<?php
include("config.php");
if($_GET['key'] && $_GET['reset'])
{
$email=password_hash($_GET['key'],PASSWORD_DEFAULT);
$pass=password_hash($_GET['reset'],PASSWORD_DEFAULT);
$sql=mysqli_query($conn,"SELECT email, password FROM registo where email='$email' and password='$pass'");
$r = mysqli_query($conn, $sql); // Linha 8
$count = mysqli_num_rows($r); // Linha 9
if(mysqli_num_rows($sql)==1)
{
?>
<html>
<form method="post" action="update_newpassword.php">
<input type="hidden" name="email" value="
<?php echo $email;?>">
<p>
Enter New password
</p>
<input type="password" name='password'>
<input type="submit" name="submit_password">
</form>
</html>
<?php
}
}
?>