WordPress.org

Ready to get started?Download WordPress

Forums

SQL query trouble (4 posts)

  1. esky
    Member
    Posted 8 years ago #

    I made my problem into a picture to better illustrate what's happening:

    http://dodnation.net/problem.png

    I want to show recent posts in this format:
    month/day: post title (comment count)

    However my attempts either filter out uncommented posts or don't count the comments correctly...

  2. esky
    Member
    Posted 8 years ago #

    Here is my full code... like I said, all I want is a little box that has my latest posts and their comment count (or 0 if no comments)...

    http://dodnation.net/get_newsposts.txt

  3. jaseone
    Member
    Posted 8 years ago #

    Do some Googling on MySQL outer joins as you want to do an outer join to the comments table.

  4. esky
    Member
    Posted 8 years ago #

    Could you please be more specific? I'm rather new to SQL... also, I can't be the first person to attempt to display posts with their comment counts next to them like that.. but I failed to find anything pointing me how to do this :(

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags