Jump to content

Order results by its occurrence inside an array


prw

Recommended Posts

I wish to order my results by its occurrence inside the $status array.

 

Basically all of the results with the status 'New' are to be listed first, then the results with the status Today, Tomorrow, Soon and so on.

 

Is this possible, or is there alternatively a different approach to ordering my results how I desire?

 

$status = array('New', 'Today', 'Tomorrow', 'Soon', 'Future', 'Complete'); 

$display->get_results("SELECT * FROM todo ORDER by status DESC");

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.