Forums :: Blogs :: Blog entry for 18 September 2005 01:06:19 GMT

18th September 2005 01:06:19 GMT
Blog entry for 18 September 2005 01:06:19 GMT
Rob's avatar

85 post(s) since
24th November 2004 22:22:29 GMT
I've finally got the blogs database calls down to just one, and here is the SQL...

SELECT blogs.*,, COUNT(
FROM blogs
    LEFT JOIN threads ON = AND threads.title LIKE 'Blog Entry for %'
    LEFT JOIN posts ON = posts.threadId
LIMIT $blogOffset, 10;

Before today, each blog entry had another SQL statement to determine the number of comments made, making eleven database calls in total.  Now there's just one.

I understand that joining a blog and forum together in this manner isn't terribly robust.  Using the date (accurate to only one second) and that the thread's title starts with "Blog Entry for", will have to do until I can come up with something better.
"Prepare for an oblivion for which there is no preparation." - O'Malley (Red Vs Blue)
28th September 2005 19:24:01 GMT
Blog Entry for 18 September 2005 01:06:19 GMT
3 post(s) since
7th December 2004 10:23:13 GMT

No - I love this site.  SO enriching.  Now - go to  It so good.  Write me a message beeathcthatch

Add Post

You must be Archangel/1B or greater to add posts to this thread.

Valid XHTML 1.1 Strict Valid CSS