aboutsummaryrefslogtreecommitdiffstats
path: root/include/dblayer
diff options
context:
space:
mode:
Diffstat (limited to 'include/dblayer')
-rw-r--r--include/dblayer/functions_pdo-sqlite.inc.php4
-rw-r--r--include/dblayer/functions_pgsql.inc.php6
-rw-r--r--include/dblayer/functions_sqlite.inc.php4
3 files changed, 4 insertions, 10 deletions
diff --git a/include/dblayer/functions_pdo-sqlite.inc.php b/include/dblayer/functions_pdo-sqlite.inc.php
index 2f1727e75..ea47564f0 100644
--- a/include/dblayer/functions_pdo-sqlite.inc.php
+++ b/include/dblayer/functions_pdo-sqlite.inc.php
@@ -413,9 +413,7 @@ function pwg_db_concat($array)
function pwg_db_concat_ws($array, $separator)
{
- $glue = sprintf(' || \'%s\' || ', $separator);
-
- return implode($array, $glue);
+ return implode($array, ' || \''.$separator.'\' || ');
}
function pwg_db_cast_to_text($string)
diff --git a/include/dblayer/functions_pgsql.inc.php b/include/dblayer/functions_pgsql.inc.php
index 8a300b7ad..3c68f7816 100644
--- a/include/dblayer/functions_pgsql.inc.php
+++ b/include/dblayer/functions_pgsql.inc.php
@@ -449,14 +449,12 @@ WHERE tablename like \''.$prefixeTable.'%\'';
function pwg_db_concat($array)
{
- $string = implode($array, ',');
- return 'ARRAY_TO_STRING(ARRAY['.$string.'])';
+ return implode($array, ' || ');
}
function pwg_db_concat_ws($array, $separator)
{
- $string = implode($array, ',');
- return 'ARRAY_TO_STRING(ARRAY['.$string.'],\''.$separator.'\')';
+ return implode($array, ' || \''.$separator.'\' || ');
}
function pwg_db_cast_to_text($string)
diff --git a/include/dblayer/functions_sqlite.inc.php b/include/dblayer/functions_sqlite.inc.php
index 7a33b09a2..7e21e128c 100644
--- a/include/dblayer/functions_sqlite.inc.php
+++ b/include/dblayer/functions_sqlite.inc.php
@@ -425,9 +425,7 @@ function pwg_db_concat($array)
function pwg_db_concat_ws($array, $separator)
{
- $glue = sprintf(' || \'%s\' || ', $separator);
-
- return implode($array, $glue);
+ return implode($array, ' || \''.$separator.'\' || ');
}
function pwg_db_cast_to_text($string)