SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict ibeblunt's Avatar
    Join Date
    Jan 2001
    Location
    Jersey City, NJ
    Posts
    312
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using MySQL To Pull One Entry Per Blog

    I'm running Movable Type 3.1.5 running about 5 blogs.

    Using SQL, I'd like to get the last entry from each blog.

    This is the query I have thus far:

    SELECT mt_blog.blog_id, mt_blog.blog_name, mt_blog.blog_site_url, mt_entry.entry_basename, mt_entry.entry_modified_on, mt_entry.entry_title, mt_entry.entry_created_on
    FROM mt_blog, mt_entry
    WHERE mt_entry.entry_blog_id = mt_blog.blog_id
    ORDER BY mt_entry.entry_created_on DESC
    LIMIT 0 , 30

    This returns:

    2 - Mr. Irreverent - Missy Elliott - Road To Failure
    4 - Media Chin Check - 40oz_parodies
    4 - Media Chin Check - All Write Already
    3 - Ya Heard - Rumorville
    2 - Mr. Irreverent - Funkmaster Flex: Hide Or Cry Chick
    4 - Media Chin Check - Funk Flex Reneges on Peacemaker Role
    5- Connect Politic - Lovers & Friends: New HIV Strain
    2 - Mr. Irreverent - SOHH What You Saying?
    4 - Media Chin-Check - Vibe Hates/Loves Misogyny
    3 - Ya Heard - The Black Fat Joe Called It
    2 - Mr. Irreverent - Harlemworld Trumped On The Apprentice!
    2 - Mr. Irreverent - Kanye West - Stop Sucking Yourself
    2 - Mr. Irreverent - Jadakiss - Overated? Or Am I Just Hating

    The first column is the BLOG ID. What I'd like it to do is just return the following rows.

    2 - Mr. Irreverent - Missy Elliott - Road To Failure
    4 - Media Chin Check - 40oz_parodies
    3 - Ya Heard - Rumorville
    5- Connect Politic - Lovers & Friends: New HIV Strain

    I thought using a DISTINCT would help, but no go.

    Any suggestions?
    <///////~

    www.sohh.com

  2. #2
    SitePoint Addict ibeblunt's Avatar
    Join Date
    Jan 2001
    Location
    Jersey City, NJ
    Posts
    312
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've also tried:

    SELECT DISTINCT(blog_name), mt_blog.blog_id, mt_blog.blog_site_url, mt_entry.entry_basename, mt_entry.entry_modified_on, mt_entry.entry_title, mt_entry.entry_created_on
    FROM mt_blog, mt_entry WHERE mt_entry.entry_blog_id = mt_blog.blog_id ORDER BY mt_entry.entry_created_on DESC

    No go.
    <///////~

    www.sohh.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •