通过自定义数组对行进行排序

时间:2018-12-29 04:49:36

标签: php mysql

是否可以通过另一个表或以某种方式给出的ids的自定义数组对行进行排序。

$str = "5,2,3,6,911,18,118,65,985,15...";  

$arr = explode(',', $str);

function get_titles($status){
    global $db;
    $sql = "select * from arts where status = :astatus order by " . $arr . " asc";
    $st = $db->prepare($sql);
    $st->execute([":astatus" => $status]);
    ...
}

1 个答案:

答案 0 :(得分:0)

如果要通过自定义#ja-JP, #en-SG{display: initial;}订单订购...

id
相关问题