Last active
November 15, 2016 09:31
-
-
Save Gesparo/7c266fedef7c89793bd862537746e362 to your computer and use it in GitHub Desktop.
Convert SQL result into array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Convert query result into two-dimensional array | |
* @param $queryResult - sql query result | |
* @return array | |
*/ | |
function convertResult($queryResult) | |
{ | |
$result = []; | |
while ($row = mysqli_fetch_assoc($queryResult)) { | |
$result[] = $row; | |
} | |
return $result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment