subset)) { $this->subset = "avg_sand"; return; } switch($this->subset){ case "avg": $this->subset = "avg_sand"; break; case "max" : $this->subset = "max_sand"; break; case "min" : $this->subset = "min_sand"; break; } return; } public function getData() { $sql = "SELECT * FROM data_sands2009 ORDER BY year ASC, month ASC "; $rs = $this->db->query($sql); return $rs; } public function outPut() { $this->switchDataset(); $rs = $this->getData(); $data = array(); while($row = $rs->fetch()) { $row['utctime'] = $this->utcMsTime(mktime(0,0,0,$row['month'],0,$row['year'])); $data[] = array($row['utctime'],$row[$this->subset]); } return $data; } }