Query Problem
-
Hi.
I have this query:
$querystr = " SELECT $wpdb->posts.* FROM $wpdb->posts, $wpdb->top, $wpdb->term_relationships WHERE $wpdb->posts.ID = $wpdb->top.post_id AND $wpdb->top.DIA_FINAL >= NOW() AND $wpdb->top.ESTADO = 'OK' AND $wpdb->posts.ID = $wpdb->term_relationships.object_id AND $wpdb->term_relationships.term_taxonomy_id = (8,33) ORDER BY RAND() LIMIT 50 ";
The query works, but not fine:
I want resolve all post for term_taxonomy_id = 8 and inside all post of category 8, all of category 33. I want not all post of each category.
Any idea?
thanks
- The topic ‘Query Problem’ is closed to new replies.