View Full Version : query to get number of forums in category?
how can i automatically count the number of forums in a category?
SELECT
count(forumid) AS forums
FROM
forum
WHERE
parentid = 5
Replace the "5" in parentid with the ID of the forum that is serving as the category. You'll need to add a prefix in front of "forum" if you have your vB installed using one.
Dismounted
05-25-2009, 05:53 AM
Note that the query will not count sub-forums. Also, you are probably better off using data from the datastore (although this is a little more advanced).
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.