Changeset 4387 for trunk/include/dblayer


Ignore:
Timestamp:
Nov 29, 2009, 3:06:16 PM (14 years ago)
Author:
nikrou
Message:

Feature_1255:

  • bug fix : function pwg_db_get_recent_period_expression
  • add extra fields for select based on "order by"
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/dblayer/functions_mysql.inc.php

    r4385 r4387  
    459459}
    460460
    461 function pwg_db_get_recent_period_expression($period, $date='CURRENT_DATE')
    462 {
    463   if ($date!='CURRENT_DATE')
    464   {
    465     $date = '\''.$date.'\'';
    466   }
    467 
    468   return 'SUBDATE('.$date.',INTERVAL '.$period.' DAY)';
    469 }
    470 
    471 function pwg_db_get_recent_period($period, $date='CURRENT_DATE')
    472 {
    473   $query = '
    474 SELECT '.pwg_db_get_recent_period_expression($period);
    475   list($d) = pwg_db_fetch_row(pwg_query($query));
    476 
    477   return $d;
     461function pwg_db_concat_ws($string, $separaor)
     462{
     463  return 'CONCAT_WS(\''.$separaor.'\','. $string.')';
     464}
     465
     466function pwg_db_cast_to_text($string)
     467{
     468  return 'CAST('.$string.' AS CHAR)';
    478469}
    479470
Note: See TracChangeset for help on using the changeset viewer.