• Hi

    I have a query that is working fine as follows

    <?php
    					global $wpdb;
    					$latest_posts = $wpdb->get_results('SELECT p.* FROM ' . $wpdb->posts . ' p LEFT JOIN ' . YAPB_TABLE_NAME . ' yi ON p.ID = yi.post_id WHERE p.post_type = \'post\' AND yi.URI IS NOT NULL ORDER BY RAND() LIMIT 0,' . $imagecount);
    					$thumbConfig = array('h=633','w=950','q=80'); //Change variables here
    				?>

    I would like to modify it to only select from Category ID 536.

    Help would be greatly appreciated

    Rog
    http://www.popcornphotography.com.au

The topic ‘SQL Query – Select only one category’ is closed to new replies.