Feature_1255:

- bug fix : function pwg_db_get_recent_period_expression
- add extra fields for select based on "order by"

git-svn-id: http://piwigo.org/svn/trunk@4387 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
nikrou 2009-11-29 14:06:16 +00:00
parent c96097529e
commit ad796f152f
4 changed files with 24 additions and 27 deletions

View file

@ -458,23 +458,14 @@ function do_maintenance_all_tables()
}
}
function pwg_db_get_recent_period_expression($period, $date='CURRENT_DATE')
function pwg_db_concat_ws($string, $separaor)
{
if ($date!='CURRENT_DATE')
{
$date = '\''.$date.'\'';
}
return 'SUBDATE('.$date.',INTERVAL '.$period.' DAY)';
return 'CONCAT_WS(\''.$separaor.'\','. $string.')';
}
function pwg_db_get_recent_period($period, $date='CURRENT_DATE')
function pwg_db_cast_to_text($string)
{
$query = '
SELECT '.pwg_db_get_recent_period_expression($period);
list($d) = pwg_db_fetch_row(pwg_query($query));
return $d;
return 'CAST('.$string.' AS CHAR)';
}
/**