38961-vm/db/content_manager.php
2026-03-04 08:52:30 +00:00

17 lines
542 B
PHP

<?php
require_once __DIR__ . '/config.php';
function get_content($key) {
$stmt = db()->prepare("SELECT * FROM site_content WHERE section_key = ?");
$stmt->execute([$key]);
return $stmt->fetch();
}
function update_content($key, $title, $content) {
$stmt = db()->prepare("INSERT INTO site_content (section_key, title, content)
VALUES (?, ?, ?)
ON DUPLICATE KEY UPDATE title = ?, content = ?");
return $stmt->execute([$key, $title, $content, $title, $content]);
}
?>