The sql_date_proche()
function is used to return a conditional expression for a column in relation to a date.
It accepts 5 parameters:
-
$champ
is the SQL column to be compared, -
$interval
is the comparison interval value: -3, 8, ... -
$unite
is 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);