[wp-trac] [WordPress Trac] #19525: Meta Query failing to build a proper SQL Query

WordPress Trac wp-trac at lists.automattic.com
Tue Dec 13 03:18:45 UTC 2011


#19525: Meta Query failing to build a proper SQL Query
--------------------------+----------------------
 Reporter:  peshkohacka   |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Query         |     Version:  3.3
 Severity:  normal        |  Resolution:  invalid
 Keywords:                |
--------------------------+----------------------
Changes (by scribu):

 * status:  new => closed
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 NOT BETWEEN requires an array for the value:

 {{{
 $args = array(
         'category_name' => 'customcat',
         'post_status' => 'publish',
         'meta_key' => 'time',
         'meta_value' => array( 1, 1000 ),
         'meta_type' => 'numeric',
         'meta_compare' => 'NOT BETWEEN'
     );
 $posts = new WP_Query($args);
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19525#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list