RE: [PHP] code not working...help?

2004-10-08 Thread Graham Cossey
[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

Re: [PHP] code not working...help?

2004-10-07 Thread Andrew Kreps
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

Re: [PHP] code not working...help?

2004-10-07 Thread Matthew Sims
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?

RE: [PHP] code not working...help?

2004-10-07 Thread Graham Cossey
[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);

Re: [PHP] code not working...help? Found problem =(

2004-10-07 Thread Matthew Kiehne
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,

RE: [PHP] code not working...help?

2004-10-07 Thread Dennis Gearon
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