开发者

Fatal error: Call to 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜