From ae2bad5ab4ca7f809604534e757340c0408b1dc2 Mon Sep 17 00:00:00 2001 From: Johannes Feichtner Date: Sun, 21 Feb 2016 14:20:30 +0100 Subject: [PATCH] Declare prepared statement only once --- admin_customers.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/admin_customers.php b/admin_customers.php index 7d2b9448..dc76d81f 100644 --- a/admin_customers.php +++ b/admin_customers.php @@ -914,10 +914,10 @@ if ($page == 'customers' // set ip <-> domain connection $defaultips = explode(',', Settings::Get('system.defaultip')); - foreach ($defaultips as $defaultip) { - $ins_stmt = Database::prepare(" + $ins_stmt = Database::prepare(" INSERT INTO `" . TABLE_DOMAINTOIP . "` SET `id_domain` = :domainid, `id_ipandports` = :ipid" - ); + ); + foreach ($defaultips as $defaultip) { Database::pexecute($ins_stmt, array('domainid' => $domainid, 'ipid' => $defaultip)); } @@ -1276,10 +1276,10 @@ if ($page == 'customers' // set ip <-> domain connection $defaultips = explode(',', Settings::Get('system.defaultip')); - foreach ($defaultips as $defaultip) { - $ins_stmt = Database::prepare(" + $ins_stmt = Database::prepare(" INSERT INTO `" . TABLE_DOMAINTOIP . "` SET `id_domain` = :domainid, `id_ipandports` = :ipid" - ); + ); + foreach ($defaultips as $defaultip) { Database::pexecute($ins_stmt, array('domainid' => $domainid, 'ipid' => $defaultip)); }