mercredi 31 mai 2017

show data only if currentmonth and currentyear are larger than

Let say currentmonth is 06 and currentyear 2017

i have dropdown of year and month .. if i select year 2017 and month of July which is larger then currentmonth
how do i show there is not data available yet

my current code..and its not working..i'm a newbie and not sure im doing this right or not...

$mystartingyear=2017;
$mystartingmonth=01;

$currentmonth=date("m");
$currentyear=date("Y");

if ($currentyear >= $mystartingyear && $currentmonth >= $mystartingmonth)
{
echo "Show Data":
}
else
{
echo "No Data yet";
}

Aucun commentaire:

Enregistrer un commentaire