summaryrefslogtreecommitdiff
path: root/lib/stored_config.php
blob: 2e7dc8adc94c6b99e1924c9f486aac6b6feead00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php

function scGet(string $key) {
    $db = DB();
    $q = $db->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);
}