here is my code
<?php
session_start();
require_once 'conenct.php';
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$username = $_POST["user"];
$Pass = $_POST["password"];
$sql = "SELECT id, username, Pass, Fullname, Department, Disgnation FROM tblaccounts WHERE username = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("s", $username);
$stmt->bind_Param("password", $Pass);
$stmt->execute();
$stmt->store_result();
if ($stmt->num_rows > 0) {
$stmt->bind_result($id, $username, $Pass, $fullname, $department, $Disgnation);
$stmt->fetch();
if (password_verify($Pass, $Pass)) {
$_SESSION["loggedin"] = true;
$_SESSION["id"] = $id;
$_SESSION["username"] = $username;
$_SESSION["fullname"] = $fullname;
$_SESSION["department"] = $department;
$_SESSION["Disgnation"] = $Disgnation;
header("location: index.php");
} else {
echo "Invalid username or password.";
}
} else {
echo "Invalid username or password.";
}
$stmt->close();
}
$conn->close();
?>
here is my error
Fatal error: Uncaught ArgumentCountError: The number of elements in the type definition string must match the number of bind variables in C:\xampp\htdocs\inven-it\buy\lg.php:12 Stack trace: #0 C:\xampp\htdocs\inven-it\buy\lg.php(12): mysqli_stmt->bind_param('password', 'admin') #1 {main} thrown in C:\xampp\htdocs\inven-it\buy\lg.php on line 12
how to fix this
<?php
session_start();
require_once 'conenct.php';
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$username = $_POST["user"];
$Pass = $_POST["password"];
$sql = "SELECT id, username, Pass, Fullname, Department, Disgnation FROM tblaccounts WHERE username = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("s", $username);
$stmt->bind_Param("password", $Pass);
$stmt->execute();
$stmt->store_result();
if ($stmt->num_rows > 0) {
$stmt->bind_result($id, $username, $Pass, $fullname, $department, $Disgnation);
$stmt->fetch();
if (password_verify($Pass, $Pass)) {
$_SESSION["loggedin"] = true;
$_SESSION["id"] = $id;
$_SESSION["username"] = $username;
$_SESSION["fullname"] = $fullname;
$_SESSION["department"] = $department;
$_SESSION["Disgnation"] = $Disgnation;
header("location: index.php");
} else {
echo "Invalid username or password.";
}
} else {
echo "Invalid username or password.";
}
$stmt->close();
}
$conn->close();
?>
here is my error
Fatal error: Uncaught ArgumentCountError: The number of elements in the type definition string must match the number of bind variables in C:\xampp\htdocs\inven-it\buy\lg.php:12 Stack trace: #0 C:\xampp\htdocs\inven-it\buy\lg.php(12): mysqli_stmt->bind_param('password', 'admin') #1 {main} thrown in C:\xampp\htdocs\inven-it\buy\lg.php on line 12
how to fix this