0

I moved my code from test server to hostgator and I receive this error:

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

I've coded so many lines with fetch_all that it will be quite tiresome to change it all.

What is the easiest way to get around this problem?

sample 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;
}

1 Answers1

0

Enable PHP 5.3 on Hostgator: http://support.hostgator.com/articles/hosting-guide/hardware-software/php-5-3.

deceze
  • 510,633
  • 85
  • 743
  • 889
  • I tried to include that line htaccess and it didn't work. Still getting error. Waiting 30min in support line to talk with them :) –  Apr 06 '13 at 13:37