From 5b71dab0c70ebcb69d5b47e252505997987f304f Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Sat, 6 Jun 2020 18:27:22 +0100 Subject: [PATCH] Change INSERT statement to INSERT OR IGNORE on adlist management as a workaround for now Signed-off-by: Adam Warner --- scripts/pi-hole/php/groups.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pi-hole/php/groups.php b/scripts/pi-hole/php/groups.php index 7b28c263..1eb4e72b 100644 --- a/scripts/pi-hole/php/groups.php +++ b/scripts/pi-hole/php/groups.php @@ -746,7 +746,7 @@ if ($_POST['action'] == 'get_groups') { $total = count($addresses); $added = 0; - $stmt = $db->prepare('INSERT INTO adlist (address,comment) VALUES (:address,:comment)'); + $stmt = $db->prepare('INSERT OR IGNORE INTO adlist (address,comment) VALUES (:address,:comment)'); if (!$stmt) { throw new Exception('While preparing statement: ' . $db->lastErrorMsg()); }