The sql_date_proche() function is used to return a conditional expression for a column in relation to a date.
It accepts 5 parameters:
-
$champis the SQL column to be compared, -
$intervalis the comparison interval value: -3, 8, ... -
$uniteis the units of reference (’DAY’, ’MONTH’, ’YEAR’, ...) -
$serveur, -
$option.
It is used as shown below:
$ifdate = sql_date_proche('column', -8, 'DAY');
$res = sql_select('column', 'table', $ifdate);