Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
in Q2A Core by
What query do I need to use to get the count of questions related to a tag?

I added some tags to the sidebar, but I'd like to add just to the right the amount of questions that use that tag as well.
edited by
With newer versions of q2a, this is implemented in tag list. Check http://www.question2answer.org/qa/tags

You can use Noah's code below for a selfcreated widget.

1 Answer

+1 vote
Something like this:

$count = qa_db_read_one_value(
        'SELECT COUNT(postid) FROM ^posttags WHERE wordid=#',
Noah, I guess this is within a post, isn't it? I actually need to get the values globally since they'll be placed in the sidebar, just aside thir corresponding tags. Any guess?
No, that's anywhere... all you need is a word id for each tag; if your widget is showing tags, you must have the word id for each tag, no?  Just pass it in as $tagid, then echo the output, $count.