function getall_months() { connect(); $query = "SELECT * FROM dbMonthsORDER BY end_of_month_timestamp"; $result = mysql_query($query); $theMonths = []; while ($result_row = mysql_fetch_assoc($result)) { $theMonth = new Month($result_row['id'], $result_row['group'], $result_row['status']); $theMonth->set_end_of_month_timestamp($result_row['end_of_month_timestamp']); $theMonths[] = $theMonth; } return $theMonths; }