首先从特定值开始对数据库结果进行排序Kohana PHP

I am sorting results from my database, but for one of them i would like to display specific values first, below is the how i am currently sorting them, by store_type DESC,

elseif (Session::Instance()->get('country') == 'it') {
                            $stmt->order_by('`store_type`', 'DESC');

this works fine, however i would like to change the order so that values with id 8, 9, 10 are displayed first, then all other results, currently it is starting with id 13 as this is the end of my table and it is sorting DESC

Could anybody point me in the right direction on how to achieve this? I am using Kohana framework.

If I understood correctly you have to change DESC with ASC

elseif (Session::Instance()->get('country') == 'it') {
                        $stmt->order_by('`store_type`', 'ASC');

try this

order by case when store_type in (8,9,10) then 1 else store_type end,store_type DESC

Try this ...

 order by find_in_set(`store_type`, '10,9,8') desc;

If you are asking for the ascending order then just replace your DESC with ASC. if you don't want ans like this then kindly elaborate so that we can help you out.

elseif (Session::Instance()->get('country') == 'it') { $stmt->order_by('store_type', 'ASC');