sqlite backend for macs and known_macs

This commit is contained in:
sandb
2010-02-28 19:15:10 +01:00
parent b08f87e9e5
commit 7d0161f6e2
4 changed files with 69 additions and 14 deletions

View File

@@ -16,8 +16,7 @@ function macs_get() {
function macs_add($mac) {
$db = get_db();
$mac = sqlite_escape_string($mac);
$q = sqlite_exec($db, "insert into macs values (\"$mac\", strftime('%s','now'))");
if (!$q) return $results;
return sqlite_exec($db, "insert or replace into macs values (\"$mac\", strftime('%s','now'))");
}
function macs_purge() {