Changeset 6581 for branches/2.1/include


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

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

Location:
branches/2.1/include/dblayer
Files:
3 edited

Legend:

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

    r6579 r6581  
    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
  • branches/2.1/include/dblayer/functions_pgsql.inc.php

    r6579 r6581  
    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
  • branches/2.1/include/dblayer/functions_sqlite.inc.php

    r6579 r6581  
    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.