From 345d50b8ae5131de9bb93a4a1d867e5f3fc7317c Mon Sep 17 00:00:00 2001 From: cp6 Date: Sun, 20 Feb 2022 16:39:52 +1100 Subject: [PATCH] Updated insert label query Updated insert label query --- app/Http/Controllers/DomainsController.php | 2 +- app/Http/Controllers/ServerController.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/DomainsController.php b/app/Http/Controllers/DomainsController.php index fcd9bf0..3f115b8 100644 --- a/app/Http/Controllers/DomainsController.php +++ b/app/Http/Controllers/DomainsController.php @@ -88,7 +88,7 @@ class DomainsController extends Controller for ($i = 1; $i <= 4; $i++) { if (!is_null($labels_array[($i - 1)])) { - DB::insert('INSERT INTO labels_assigned (label_id, service_id) values (?, ?)', [$labels_array[($i - 1)], $domain_id]); + DB::insert('INSERT IGNORE INTO labels_assigned (label_id, service_id) values (?, ?)', [$labels_array[($i - 1)], $domain_id]); } } diff --git a/app/Http/Controllers/ServerController.php b/app/Http/Controllers/ServerController.php index bef50af..4d7e436 100644 --- a/app/Http/Controllers/ServerController.php +++ b/app/Http/Controllers/ServerController.php @@ -128,7 +128,7 @@ class ServerController extends Controller for ($i = 1; $i <= 4; $i++) { if (!is_null($labels_array[($i - 1)])) { - DB::insert('INSERT INTO labels_assigned (label_id, service_id) values (?, ?)', [$labels_array[($i - 1)], $server_id]); + DB::insert('INSERT IGNORE INTO labels_assigned (label_id, service_id) values (?, ?)', [$labels_array[($i - 1)], $server_id]); } }