function date_sql_concat in Date 7
Same name and namespace in other branches
- 8 date_api/date_api.module \date_sql_concat()
- 5.2 date_api_sql.inc \date_sql_concat()
- 5 date.inc \date_sql_concat()
- 6.2 date_api_sql.inc \date_sql_concat()
- 6 date_api_sql.inc \date_sql_concat()
- 7.3 date_api/date_api_sql.inc \date_sql_concat()
- 7.2 date_api/date_api_sql.inc \date_sql_concat()
A helper function to do cross-database concatation of date parts
Parameters
$array - an array of values to be concatonated in sql: @return - correct sql string for database type
File
- date_api/
date_api_sql.inc, line 18 - SQL helper for Date API.
Code
function date_sql_concat($array) {
switch (date_db_type()) {
case 'mysql':
case 'mysqli':
return "CONCAT(" . implode(",", $array) . ")";
case 'pgsql':
return implode(" || ", $array);
}
}