Posted By

m-pokrovskii on 03/03/10


Tagged


Versions (?)

Wordpress. Select posts woth not something meta_key


 / Published in: PHP
 

URL: pokrovskii.com

  1. $request = "SELECT ID, post_status, post_type
  2. FROM $wpdb->posts a
  3. WHERE post_status='publish' AND post_type='post'
  4. AND NOT EXISTS(SELECT 1 FROM $wpdb->postmeta b WHERE b.post_id=a.ID AND b.meta_key = 'ImageURL')";

Report this snippet  

You need to login to post a comment.