From 6e35298f190b650b0089431aabec781c93c9f7fa Mon Sep 17 00:00:00 2001 From: Laurent Pinsivy Date: Fri, 4 Aug 2017 11:12:47 +0200 Subject: [PATCH] #5506 add coma to separate multiple values in SQL insert request (#5507) --- .../configuration/configObject/meta_service/DB-Func.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/www/include/configuration/configObject/meta_service/DB-Func.php b/www/include/configuration/configObject/meta_service/DB-Func.php index 9b298f36e99..51847cf768e 100644 --- a/www/include/configuration/configObject/meta_service/DB-Func.php +++ b/www/include/configuration/configObject/meta_service/DB-Func.php @@ -349,6 +349,9 @@ function updateMetaServiceContact($meta_id) if (count($ret)) { $queryAddRelation = "INSERT INTO meta_contact (meta_id, contact_id) VALUES "; for ($i = 0; $i < count($ret); $i++) { + if ($i > 0) { + $queryAddRelation .= ', '; + } $queryAddRelation .= "(" . $meta_id . ", " . $ret[$i] . ")"; } $pearDB->query($queryAddRelation);