On Tue, Mar 16, 2004 at 09:43:28AM -0800, Jason Davidson wrote:
> Most likely im not understanding your question.. but, if you are trying
> to calculate the total rows by month..
> SELECT whatever FROM table WHERE MONTH(your_date) = '03';
> 
> and use num_rows or row_count or whatever the php mysql function is

I didn't post the original message; I was responding to Tommi, who asked
about calculating the "count of date per month".

Your method will have all rows returned to PHP, and require PHP to count
the rows afterward.  If you would do this:

  SELECT COUNT(whatever) FROM table WHERE MONTH(your_date) = '03';

then your result set will only have one row (the number of matching
rows), and you don't need to do any additional counting work.

However, all of that is for the OP, not for me, so I'm CCing the list
back in.

-- 
[ joel boonstra | gospelcom.net ]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to