[wp-trac] [WordPress Trac] #14234: ORDER BY FIELD() query not working with $wpdb

WordPress Trac wp-trac at lists.automattic.com
Thu Jul 8 01:27:47 UTC 2010

#14234: ORDER BY FIELD() query not working with $wpdb
 Reporter:  stoosh        |       Owner:                 
     Type:  defect (bug)  |      Status:  new            
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Database      |     Version:  2.9.2          
 Severity:  minor         |    Keywords:                 
 Trying to custom order a query using the FIELD() function, doesn't seem to
 work with the Wpdb::query method.

 An example query is
 SELET * FROM wp_table WHERE id in (9,4,1,2) ORDER BY FIELD(9,4,1,2)

 The query executes but doesn't correctly order

Ticket URL: <http://core.trac.wordpress.org/ticket/14234>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list