> i just realized that the dates in the database are saved as > varchar (althought they are numbers) is there anyway to compare the > $lastmonth value (which returns as a 14 digit number) to that because > the > way i have it now with >> post_date <= '$lastmonth' > wont work because post_date is varchar and $lastmonth is an interger > right? > > >
Have you thought about using MySQL's datetime rather than creating your own? http://dev.mysql.com/doc/mysql/en/DATETIME.html You have $lastmonth as YYMMddHHmmss. Why not do it as YY-MM-dd HH:mm:ss, like: $lastmonth = date("Y-m-d H:i:s", mktime(date("H"), date("i"), date("s"), date("m")-1, date("d"), date("Y")); MySQL will suck it up much better that way. -- --Matthew Sims --<http://killermookie.org> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php