The array is storing the entire table with 18 columns and 3 rows.
Here is the function being called:
Expand|Select|Wrap|Line Numbers
- function topPilots($startTime, $endTime, $orderBy) // Retrieves list of pilots order
- {
- $sql = "SELECT * FROM completedFlights";
- $result = mysql_query($sql);
- $array = mysql_fetch_array($result, MYSQL_ASSOC);
- return $array;
- }
Expand|Select|Wrap|Line Numbers
- $array = topPilots($thisMonthStart, time(), "SUM(cargo)");
- foreach($array as $key => $value)
- {
- echo $key.": ".$value." <br />";
- }