0

我将代码从测试服务器移动到 hostgator 并收到此错误:

Fatal error: Call to undefined method mysqli_result::fetch_all()

我已经用 fetch_all 编写了这么多行,要全部改变它会很烦人。

解决此问题的最简单方法是什么?

示例 php:

function get_all_map_users() {
        $mysqli = new mysqli(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME);
        if ($mysqli->connect_error) {
            //Failed to connect
            die('Could not connect: ' . $mysqli->connect_error . ' - ' . $mysqli->connect_errno);
        }
        //Success
                            $result = $mysqli->query("SELECT * FROM names");
                            $rows = $result->fetch_all(MYSQLI_ASSOC);

                            //Clear result set
                            $result->free();
        //End mysql query
        //Close mysqli connection
        $mysqli->close();

        return $rows;
}
4

1 回答 1

0

在 Hostgator 上启用 PHP 5.3:http: //support.hostgator.com/articles/hosting-guide/hardware-software/php-5-3

于 2013-04-06T13:36:31.923 回答