Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

Usando Order By no codeigniter


Melhor usar assim
$ids = "1,3,2,4";
$qry ="SELECT * FROM (`destination`) WHERE `id` IN ($ids) ORDER BY `FIELD` ( id, $ids )";
$result = $this->db->query($qry);
return $result->result();