|
|
Count One Table's Rows From Multi Table Query
here are my tables (condensed)
FEEDS feed_id site_id
SITE site_id site_name
ARTICLES article_id feed_id link
I want to create a query that returns the total number of articles for every site_id (which is unique in the SITE table). I have this:
PHP
$gsite = mysql_query("SELECT site.site_id, feeds.feed_id, COUNT(articles.article_id) AS acont FROM site,feeds,articles WHERE feeds.site_id = site.site_id AND articles.feed_id = feeds.feed_id group by site.site_id", $connection) or die(mysql_error());
The query does not use JOIN, ON and all that good stuff.
I just need the following variables to run through a loop:
site_id the number of articles rows per site_id
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
|
|
|