Changeset 6580 for trunk


Ignore:
Timestamp:
Jun 22, 2010, 11:18:42 PM (14 years ago)
Author:
nikrou
Message:

Bug 1737 fixed : Concatenation error with POstgreSQL
Simplify same function for SQLite

Location:
trunk/include/dblayer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/dblayer/functions_pdo-sqlite.inc.php

    r6578 r6580  
    414414function pwg_db_concat_ws($array, $separator)
    415415{
    416   $glue = sprintf(' || \'%s\' || ', $separator);
    417 
    418   return implode($array, $glue);
     416  return implode($array, ' || \''.$separator.'\' || ');
    419417}
    420418
  • trunk/include/dblayer/functions_pgsql.inc.php

    r6578 r6580  
    450450function pwg_db_concat($array)
    451451{
    452   $string = implode($array, ',');
    453   return 'ARRAY_TO_STRING(ARRAY['.$string.'])';
     452  return implode($array, ' || ');
    454453}
    455454
    456455function pwg_db_concat_ws($array, $separator)
    457456{
    458   $string = implode($array, ',');
    459   return 'ARRAY_TO_STRING(ARRAY['.$string.'],\''.$separator.'\')';
     457  return implode($array, ' || \''.$separator.'\' || ');
    460458}
    461459
  • trunk/include/dblayer/functions_sqlite.inc.php

    r6578 r6580  
    426426function pwg_db_concat_ws($array, $separator)
    427427{
    428   $glue = sprintf(' || \'%s\' || ', $separator);
    429 
    430   return implode($array, $glue);
     428  return implode($array, ' || \''.$separator.'\' || ');
    431429}
    432430
Note: See TracChangeset for help on using the changeset viewer.