I want to write query like this in MeekroDB:
SELECT * FROM `tablename` WHERE `id` IN (3,1,2) ORDER BY FIELD (`id`,3,1,2)
And I expect it to work like this in meekro:
$possible_ids = array(1,2,3);
DB::query('SELECT * FROM `tablename` WHERE `id` IN %ld0 ORDER BY FIELD (`id`,%ld0)', $possible_ids);
But it get this:
SELECT * FROM `tablename` WHERE `id` IN (3,1,2) ORDER BY FIELD (`id`,(3,1,2))
Is there any way to avoid this brackets here?
Try this one :
also you can check with echo query. try it's working fine.