PHP MySQL curdate() -
in mysql, can use:
select * container containerdate = curdate() + 1;
that returns containerdate within 24 hours of current date.
but now, need put php.
i have php variable called $next_day. how can curdate() + 1 variable query runs in php how in mysql?
in form, tried set value of "curdate() + 1", reads in string, , therefore, php reads value single quotes, ie: 'curdate() + 1'
is there way set variable $next_day curdate() + 1 ?
please advise.
$date = new datetime(); $date->modify('+1 day');
with first command obtain today date, second, modify adding 1 day (tomorrow date)
try yourself: phpfiddle
Comments
Post a Comment