my code is as follow...


$sql="
select *
  from ads
 where category = '$category_id'
   and action = '1'
 order
    by feature desc";


在此阶段,仅那些展示在顶部的产品具有最大的功能。现在应该根据其ID描述显示其余产品。
我必须在此查询中添加什么语法,请提出建议。

最佳答案

select *
from ads
where category = '$category_id'
and action = '1'
order by feature desc, id desc

关于php - 我想先展示特色产品,然后再展示其他产品(按id desc排序),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/34310221/

10-09 20:15