sql - PHP today / yesterday in forum -
i'm showing latest activity on forum, , i'm extracting "$mytime" sql. , can't seem figure 1 out:
$dates = date(" d-m-y",$mytime)); if($dates == date('d-m-y')) { $day_name = 'this day'; } else if(); $day_name = 'another day'; } echo "$day_name";
i can't figure out one: } else if(); {
is there more problems in code?
yes there problem code. should this:
$dates = date(" d-m-y",$mytime)); if ($dates == date('d-m-y')) { $day_name = 'this day'; } elseif (you-can-compare else again in here) { $day_name = 'another day'; } echo "$day_name";
or if not willing compare second time, use this:
$dates = date(" d-m-y",$mytime)); if ($dates == date('d-m-y')) { $day_name = 'this day'; } else { $day_name = 'another day'; } echo "$day_name";
Comments
Post a Comment