My php code:
<?php
require("password.php");
$connect = mysqli_connect(...);
//connect to the database
// include 'finance_connection.php';
$username = $_POST["username"];
$password = $_POST["password"];
$statement = mysqli_prepare($connect, "SELECT * FROM user WHERE username = ?");
mysqli_stmt_bind_param($statement, "s", $username);
mysqli_stmt_execute($statement);
mysqli_stmt_store_result($statement);
mysqli_stmt_bind_result($statement, $colUserID, $colName, $colUsername, $colAge, $colPassword, $colEmail);
$response = array();
$response["success"] = false;
while(mysqli_stmt_fetch($statement)){
if (password_verify($password, $colPassword)) {
$response["success"] = true;
$response["name"] = $colName;
$response["age"] = $colAge;
$response["email"] = $colEmail;
}
}
echo json_encode($response);
?>
the error
Warning: mysqli_stmt_bind_param() expects parameter 1 to be mysqli_stmt, boolean given in /storage/ssd4/966/2373966/public_html/Login2.php on line 13
Warning: mysqli_stmt_execute() expects parameter 1 to be mysqli_stmt, boolean given in /storage/ssd4/966/2373966/public_html/Login2.php on line 14
Warning: mysqli_stmt_store_result() expects parameter 1 to be mysqli_stmt, boolean given in /storage/ssd4/966/2373966/public_html/Login2.php on line 15
Warning: mysqli_stmt_bind_result() expects parameter 1 to be mysqli_stmt, boolean given in /storage/ssd4/966/2373966/public_html/Login2.php on line 16
Warning: mysqli_stmt_fetch() expects parameter 1 to be mysqli_stmt, boolean given in /storage/ssd4/966/2373966/public_html/Login2.php on line 21
mysqli_stmt_bind_param($statement, "s", $username); mysqli_stmt_execute($statement); mysqli_stmt_store_result($statement); mysqli_stmt_bind_result($statement, $colUserID, $colName, $colUsername, $colAge, $colPassword, $colEmail);
i think there's a problem with these line of code