Archive for August, 2012

CakePHP – Sort Find() results by Array of Ids? – Order by Array – MYSQL

This is one of the question I was faced in my recent project. I would like to share the same with you.

It was raised when I have to order paginate results in an order of set of IDs. I was trying to recall many scenarios. But no use.

Then I was started thinking, do MySQL have any similar option, Yes, MySQL have it’s FIELD(). It was really awesome one and which help me furnish my needs well.

Continue reading →