douchang8758 2011-01-08 18:54
浏览 39
已采纳

致命错误:调用未定义的方法mysqli_stmt :: query()

Hey guys, can any of you find out why I'm getting the above error?

$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();
  • 写回答

1条回答 默认 最新

  • dongzhukuai8177 2011-01-08 19:13
    关注

    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()?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?