SQL query trouble (4 posts)

  1. esky
    Posted 10 years ago #

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


    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
    Posted 10 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)...


  3. jaseone
    Posted 10 years ago #

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

  4. esky
    Posted 10 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