20 lines
364 B
PHP
20 lines
364 B
PHP
<?php
|
|
|
|
class CityServiceModel {
|
|
|
|
public static function get($db, $city) {
|
|
$city = (int)$city;
|
|
|
|
// Step 1: Load address
|
|
$q = "SELECT *FROM city_services WHERE city_id = ${city}";
|
|
$r = pg_query($db, $q);
|
|
if ($r && pg_num_rows($r)) {
|
|
$results = pg_fetch_all($r);
|
|
} else {
|
|
return [NULL, "Services not found"];
|
|
}
|
|
|
|
return [$results, NULL];
|
|
}
|
|
}
|