-Patrick wrote:
Folks, I could really use your assistance.
Take a look here: http://pastebin.com/687889

How can I manipulate totalRows_numberComments so that I get the number
of blg_comment_com.idart_com PER blg_article_art.id_art? Right now, it
produces every blg_comment_com.idart_com in existence, definately not cool.

Thanks
-Patrick


You had:
SELECT COUNT(*) FROM blg_comment_com, blg_article_art WHERE
blg_article_art.id_art=blg_comment_com.idart_com

Try this:

SELECT blg_article_art.id_art, COUNT(*) as NumberOfComments
FROM blg_comment_com, blg_article_art
WHERE blg_article_art.id_art = blg_comment_com.idart_com
group by blg_article_art.id_art

Try it in the mysql console before you try to plug it into php.
(You can only learn so much at one time :)

--John


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to