Posted By

drdamour on 08/28/06


Tagged

wordpress WordpressMU


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

yuconner
jbo


Select from WordpressMU Posts


 / Published in: SQL
 

  1. SELECT RECENT_POSTS.*, wp_users.display_name AS AUTHOR FROM
  2. (SELECT ALL_POSTS.* FROM
  3. (SELECT POSTS.*, post_author AS author_id FROM wp_2_posts POSTS WHERE post_status = ‘publish’ AND post_type=’post’
  4. UNION
  5. SELECT POSTS.*, post_author AS author_id FROM wp_3_posts POSTS WHERE post_status = ‘publish’ AND post_type=’post’) ALL_POSTS
  6. ORDER BY post_modified DESC LIMIT 0,20)
  7. RECENT_POSTS LEFT JOIN wp_users ON RECENT_POSTS.author_id = wp_users.ID

Report this snippet  

You need to login to post a comment.