WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#14234 closed defect (bug) (invalid)

ORDER BY FIELD() query not working with $wpdb

Reported by: stoosh Owned by:
Milestone: Priority: normal
Severity: minor Version: 2.9.2
Component: Database Keywords:
Focuses: Cc:

Description

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

Change History (2)

comment:1 @stoosh5 years ago

  • Resolution set to invalid
  • Status changed from new to closed

comment:2 @dd325 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.