From c0dc531ebefd8912819f3b6c8bda1fed3c7e750c Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Wed, 31 Jan 2024 06:11:00 +0300 Subject: make it simple, but not simpler --- lib/stored_config.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 lib/stored_config.php (limited to 'lib/stored_config.php') diff --git a/lib/stored_config.php b/lib/stored_config.php new file mode 100644 index 0000000..2e7dc8a --- /dev/null +++ b/lib/stored_config.php @@ -0,0 +1,14 @@ +query("SELECT value FROM config WHERE name=?", $key); + if (!$db->numRows($q)) + return null; + return $db->result($q); +} + +function scSet($key, $value) { + $db = DB(); + return $db->query("REPLACE INTO config (name, value) VALUES (?, ?)", $key, $value); +} -- cgit v1.2.3