Skip to content

Instantly share code, notes, and snippets.

@pierew
Last active August 29, 2015 14:14
Show Gist options
  • Save pierew/a9bc692207615d029395 to your computer and use it in GitHub Desktop.
Save pierew/a9bc692207615d029395 to your computer and use it in GitHub Desktop.
PHP Mysql -> PHP Array Converter Function
/*
* You need to set the Parameter $ResultSet to your Direct Result From $db->query("Select ...", MYSQLI_USE_RESULT)
*
*
*/
function arrayConvertMySQLToPHP($ResultSet) {
$phparray = array();
while($row = mysqli_fetch_assoc($ResultSet)){
array_push($phparray, $row);
}
return $phparray;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment