Hello there
I've used many ways but i can't find the solution,my date is stored in a "date" mySql field.
I want to display full article in 4 four months time after inserted.
$n++Code:... $art_query=mysql_query($getarticles); $n=0; while ($array=mysql_fetch_array($art_query)) { $ids[]=$array["id"]; $date_published[]=$array["date_created"]; .... //Results of query are in an array i think this makes it all hard $mydate=$date_published[$n]; //$mydate->modify("+4 month");tried this too , srttotime,getdate... // print $now; $now = mktime(0, 0, 0, date("m"), date("d"), date("Y")); $pub_date =mktime(0, 0, 0, $mydate[month]+4, $mydate[day], $mydate[year]); if ($now > $pub_date){ echo "something"; }else{ echo "something else"; } }
something is wrong with my syntax in $pub_date i guess because when i echo it displays 1-31-2000 which is not really my date record....
$now works offcourse
![]()




Reply With Quote