Changeset 4387 for trunk/include/dblayer
- Timestamp:
- Nov 29, 2009, 3:06:16 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/dblayer/functions_mysql.inc.php
r4385 r4387 459 459 } 460 460 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; 461 function pwg_db_concat_ws($string, $separaor) 462 { 463 return 'CONCAT_WS(\''.$separaor.'\','. $string.')'; 464 } 465 466 function pwg_db_cast_to_text($string) 467 { 468 return 'CAST('.$string.' AS CHAR)'; 478 469 } 479 470
Note: See TracChangeset
for help on using the changeset viewer.