开发者社区> 问答> 正文

thinkphp5 购物车按购买顺序排序?报错

db('good')->where('id','in',$id)->order('id,'.$id)->select();

总是查询失败,order里面报错 错误结果如下:

SQLSTATE[42S22]: Column not found: 1054 Unknown column '88' in 'order clause'

展开
收起
爱吃鱼的程序员 2020-06-08 16:05:50 468 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    db('good')->where('id','in',$id) ->order('id','asc')->select();

    db('good')->where('id',‘in’,$id)->order('idasc')->select();

    2020-06-08 16:06:10
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载