Counting no. of articles in section in category

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Try this and see what it does...

Code: Select all

$count=mysql_query("SELECT COUNT(`mos_content`.`catid`), `mos_categories`.`name` FROM `mos_content` INNER JOIN `mos_categories` ON `mos_content`.`sectionid` = `mos_categories`.`section` GROUP BY `mos_content`.`catid`;") or die('This query has some problems: ' . mysql_error());
Post Reply