This commit is contained in:
Mark Schouten 2014-07-04 12:50:45 +02:00
parent 93818f40e9
commit 6f9f7b3982

View file

@ -119,7 +119,7 @@ function add_db_zone($zone, $owner) {
jtable_respond(null, 'error', "$zone is not a valid zonename");
}
$db = get_db();
$q = $db->prepare("INSERT OR REPLACE INTO zones (zone, owner) VALUES (? (SELECT id FROM users WHERE emailaddress = ?))");
$q = $db->prepare("INSERT OR REPLACE INTO zones (zone, owner) VALUES (?, (SELECT id FROM users WHERE emailaddress = ?))");
$q->bindValue(1, $zone, SQLITE3_TEXT);
$q->bindValue(2, $owner, SQLITE3_TEXT);
$q->execute();