db = new PDO(); } public function getProvince() { $sql = "SELECT * FROM map_provinces"; $rs = $this->db->query($sql); $rows = $rs->fetchAll(); return $rows; } public function getCity($pid) { $sql = "SELECT * FROM map_cities WHERE provinceid=$pid"; $rs = $this->db->query($sql); $rows = $rs->fetchAll(); return $rows; } public function getArea($cid) { $sql = "SELECT * FROM map_areas WHERE cityid=$cid"; $rs = $this->db->query($sql); $rows = $rs->fetchAll(); return $rows; } }