Need Help to fix the error


Hello i need help i have follow Warning =
Warning : mysqli_stmt_bind_param(): Number of variables doesn’t match number of parameters in prepared statement in D:\XAMPP\htdocs\gameinfo.php on line 30

i need the ‘Succsess’ msg

/////// Need to Grab Username And Password
$username = $_GET[“username”];
$password = $_GET[“password”];
// create a prepared statement
$stmt = mysqli_prepare($mysqli, “SELECT username, password, regkey, banned FROM users WHERE username=’$username’”);

// bind parameters
mysqli_stmt_bind_param ($stmt,‘s’,$username); <—(( Line 30 ))

// execute query

// bind result variables
mysqli_stmt_bind_result($stmt, $username, $hashed_password, $regkey, $banned);

// fetch value

if(password_verify($password, $hashed_password)){
echo json_encode(array(‘result’ => ‘success’, ‘regkey’ => $regkey, ‘banned’ => $banned));
// incorrect password




You didnt prepare your statement with a placeholder, just look it up in the manual. Doing it right would also prevent anybody from deleting your complete database.

1 Like