[PHP-DB] SQL for Showing the number of queries served on each day.

2004-04-30 Thread Vern
I found this code below that allows me to retreive the queries served on my
server for each day but can't figure out how to actually display the
information using echo. Can some one give me an example using the following
SQL?

SELECT DATE_FORMAT(ex_date, '%Y %m %d %W'), COUNT(id)
FROM email
WHERE ex_dateNow()-INTERVAL 50 DAY
GROUP BY DATE_FORMAT(ex_date, '%Y %m %d %W')
ORDER BY DATE_FORMAT(ex_date, '%Y %m %d %W') DESC

Thanks

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



Re: [PHP-DB] SQL for Showing the number of queries served on each day.

2004-04-30 Thread John W. Holmes
Vern wrote:

I found this code below that allows me to retreive the queries served on my
server for each day but can't figure out how to actually display the
information using echo. Can some one give me an example using the following
SQL?
SELECT DATE_FORMAT(ex_date, '%Y %m %d %W'), COUNT(id)
FROM email
WHERE ex_dateNow()-INTERVAL 50 DAY
GROUP BY DATE_FORMAT(ex_date, '%Y %m %d %W')
ORDER BY DATE_FORMAT(ex_date, '%Y %m %d %W') DESC
You probably just need to use an alias.

SELECT DATE_FORMAT(ex_date, '%Y %m %d %W') as mydate,
  COUNT(id) as mycount
Then, you'll have columns called mydate and mycount in your result set.

Without knowing what database you're using, it's hard to give an example 
with exact code.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals  www.phparch.com

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


Re: [PHP-DB] SQL for Showing the number of queries served on each day.

2004-04-30 Thread Vern
That did it thanks

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