Skip to content

Instantly share code, notes, and snippets.

@KariTrace
Created September 12, 2012 19:10
Show Gist options
  • Save KariTrace/3709179 to your computer and use it in GitHub Desktop.
Save KariTrace/3709179 to your computer and use it in GitHub Desktop.
Works locally (win), remotely says "undefined method mysqli_result::fetch_all()" (CentOS 6)
...
echo("<PRE>");
print_r( $conn );// prints out mysqli Object
echo("</PRE>");
//create SQL query
$stmt = "SELECT column_name FROM information_schema.columns WHERE table_name = '". $tableName ."' ORDER BY ordinal_position";
$query = $conn->query($stmt);
//execute query
$clmNames = $query->fetch_all(MYSQLI_ASSOC); //error log states "PHP Fatal error: Call to undefined method mysqli_result::fetch_all() in ...
//clear memory
$query->free();unset($query);
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment