[snip][snip]
Secondly I find it easier (to read) to code my SQL statements thus:
$countResult = db_query(SELECT count(*) AS msgCount FROM messages WHERE
uid='$userID' AND fid='$fid' AND post_date='$lastmonth');
[snip]
/quote ---
I
On Thu, 7 Oct 2004 14:14:10 -0400, Matthew [EMAIL PROTECTED] wrote:
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
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?
[snip]
$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);
Thanks these all helped me get some things working again... except one
problem now... 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?
--
Advanced Forums,
Graham Cossey [EMAIL PROTECTED] wrote:
quote ---
[snip]
$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
6 matches
Mail list logo