public static function findFromRouteNo($parish, $routeno) { $ROWs = array(); $result = pg_query("SELECT *,ST_AsGeoJSON(the_geom) AS geojson " . "FROM hampshire WHERE parish='{$parish}' " . " AND routeno='{$routeno}'"); while ($row = pg_fetch_array($result, null, PGSQL_ASSOC)) { $rightofway = new RightOfWay(); $rightofway->loadFromRow($row); $ROWs[] = $rightofway; } return $ROWs; }