Also ich konnte jetzt durch include die SQL-Statements finden. Diese sehen so aus:
Code:
<!-- SQL 1:SELECT DISTINCT ID FROM wp_posts AS posts
INNER JOIN wp_term_relationships AS tr ON ( posts.ID = tr.object_id )
INNER JOIN wp_term_taxonomy AS tt ON ( tr.term_taxonomy_id = tt.term_taxonomy_id )
WHERE posts.post_type = 'post' AND posts.post_status = 'publish'
AND term_id IN ( 4 )-->
<!-- SQL 2:SELECT ID, post_title, post_parent FROM wp_posts AS posts
WHERE posts.post_type = 'attachment'
AND posts.post_mime_type IN ('image/jpeg','image/gif','image/jpg','image/png')
AND posts.post_parent IN ( 22,62 ) ORDER BY RAND() LIMIT 0 , 1-->
Beim SQL-1 Statement werden als Antwort 2 ID's geliefert 22,62
Beim SQL-2 Statement MySQL lieferte ein leeres Resultat zurück
Grüße
Egon