开发者

Fatal error: Call to undefined method mysqli_stmt::query()

开发者 https://www.devze.com 2023-02-03 09:38 出处:网络
Why am I getting the following error? Fatal error: Call 开发者_如何学Pythonto undefined method mysqli_stmt::query()

Why am I getting the following error?

Fatal error: Call 开发者_如何学Pythonto undefined method mysqli_stmt::query()

$mysqli = new mysqli("localhost", "***", "***", "***") or die($mysqli->connect_error);

function checklogin($username, $password)
{
    global $mysqli;

    $result = $mysqli->prepare("SELECT * FROM users WHERE username = ?");
    $result->bind_param("s", $username);
    $result->query();
}


Calling $mysqli->prepare() will return an instance of MySQLi_STMT, but the MySQLi_STMT class doesn't have a query() method. Perhaps you meant execute()?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号