$sql = "SELECT Lastname, Age FROM Persons ORDER BY Lastname";
$result = mysqli_query($con, $sql);
/*MYSQLI_ASSOC
MYSQLI_NUM (this is default)
MYSQLI_BOTH
*/
// Fetch all
mysqli_fetch_all($result, MYSQLI_ASSOC);
* The fetch_assoc() / mysqli_fetch_assoc() function fetches a result row as an associative array.
Note: Fieldnames returned from this function are case-sensitive.
mysqli_fetch_assoc(result)
mysqli_fetch_assoc()
/*its used to return associative array representing the next row in the result
set for the result represented by the result parameter*/