Return to Snippet

Revision: 1010
at August 28, 2006 11:45 by drdamour


Updated Code
SELECT RECENT_POSTS.*, wp_users.display_name as AUTHOR FROM 
   (SELECT ALL_POSTS.* FROM 
       (SELECT POSTS.*, post_author as author_id FROM wp_2_posts POSTS where post_status = ‘publish’ and post_type=’post’ 
        UNION
        SELECT POSTS.*, post_author as author_id FROM wp_3_posts POSTS where post_status = ‘publish’ and post_type=’post’) ALL_POSTS
    ORDER BY post_modified DESC LIMIT 0,20)
RECENT_POSTS LEFT JOIN wp_users ON RECENT_POSTS.author_id = wp_users.ID

Revision: 1009
at August 28, 2006 10:38 by drdamour


Initial Code
SELECT RECENT_POSTS.*, wp_users.display_name as AUTHOR FROM (SELECT ALL_POSTS.* FROM (SELECT POSTS.*, post_author as author_id FROM wp_2_posts POSTS where post_status = ‘publish’ and post_type=’post’ UNION SELECT POSTS.*, post_author as author_id FROM wp_3_posts POSTS where post_status = ‘publish’ and post_type=’post’) ALL_POSTS ORDER BY post_modified DESC LIMIT 0,20) RECENT_POSTS LEFT JOIN wp_users ON RECENT_POSTS.author_id = wp_users.ID

Initial URL

                                

Initial Description

                                

Initial Title
Select from WordpressMU Posts

Initial Tags
wordpress

Initial Language
SQL