Simple SQL question

Discussion in 'OT Technology' started by Seeders, Nov 19, 2009.

  1. Seeders

    Seeders New Member OT Supporter

    Jul 10, 2007
    Likes Received:
    Ok, i haven't databased in awhile so help me out. I have two tables, forum_posts and forum_topics.

    i want to count the total number of entries made by a single user_id in the tables, with one query.

    To be clearer, this is my current implementation:

    SELECT COUNT(*) AS c FROM `exp_forum_posts` WHERE `author_id` = 'X'
    SELECT COUNT(*) AS c FROM `exp_forum_topics` WHERE `author_id` = 'X'

    how can i get the same results with one query?
    Last edited: Nov 19, 2009

Share This Page