I try to select username from the database, and when I fetch it, I got the error message.
mysqli_stmt::fetch() expects exactly 0 parameters, 1 given in
<?php
require 'dbh.inc.php';
if(!empty($_POST['username']) && !empty($_POST['password'])):
$records = $conn->prepare('SELECT id, username, password FROM users WHERE username = ?');
$records->bind_param('s', $_POST['username']);
$records->execute() or die($records->error);
$result = $records->fetch(PDO::FETCH_ASSOC);
if(count($result) > 0 && password_verify($_POST['password'], $result['password'])){
die('We have a login');
}else{
die('Something went wrong!');
}
endif;
?>