Файловый менеджер - Редактировать - /home/skymarketplace/public_html/models/LocationModel.php
Назад
<?php namespace App\models; use PDO; class LocationModel { private PDO $db; public function __construct(PDO $db) { $this->db = $db; } public function insert(array $data): bool { $stmt = $this->db->prepare("INSERT INTO locations (country, town, delivery_price) VALUES (:country, :town, :price)"); return $stmt->execute([ 'country' => $data['country'], 'town' => $data['town'], 'price' => $data['delivery_price'] ]); } public function update(array $data): bool { $stmt = $this->db->prepare("UPDATE locations SET country = :country, town = :town, delivery_price = :price WHERE id = :id"); return $stmt->execute([ 'country' => $data['country'], 'town' => $data['town'], 'price' => $data['delivery_price'], 'id' => $data['id'] ]); } public function delete(int $id): bool { $stmt = $this->db->prepare("DELETE FROM locations WHERE id = :id"); return $stmt->execute(['id' => $id]); } public function deleteFooter(int $id): bool { $stmt = $this->db->prepare("DELETE FROM footer_locations WHERE id = :id"); return $stmt->execute(['id' => $id]); } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.31 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка