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

Popular posts from this blog

Line ending issue with Mercurial or Visual Studio -

python - Received unregistered task using Celery with Django -

php - Retrieving data submitted with Yii's CActiveForm -