code not working...help?

From: Date: Thu, 07 Oct 2004 18:14:10 +0000
Subject: code not working...help?
Groups: php.general 
Request: Send a blank email to php-general+get-198867@lists.php.net to get a copy of this message
Hi guys im pretty new at this and cant seem to get this going.... I want the code to query the database for the number of messages posted within the last month this is the code i have but its not working... I might even have it all wrong, can someone point me in the right direction? $lastmonth = date("YmdHis", mktime(date("H"), date("i"), date("s"), date("m")-1, date("d"), date("Y"))); $countResult = db_query("SELECT count(*) AS msgCount FROM messages WHERE uid = '". $userID ."' AND fid = '". $fid ."' AND post_date <= '". $lastmonth ."'"); $countRow = db_fetch_array($countResult); im then using $countRow as my variable but it keeps returning a value of zero.

« previous php.general (#198867) next »