开发者社区> 问答> 正文

mySQL数据库报错You have an error in your SQL syntax

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by cid desc' at line 1
这是一个什么错误啊,请大侠指点
SQL Error:
MySQL Query Error
select * from dg_taobao_cat where cid= order by cid desc
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by cid desc' at line 1
PHP Backtrace
File Line Function
includesdb_mysql.class.php 92 db_mysql->halt()
includestable.class.php 119 db_mysql->query()
taobao.php 79 TableClass->getdata()
taobaoview.php 144 taobao_position()
taobao.php 42 include_once()

展开
收起
落地花开啦 2016-02-14 16:09:24 136947 0
3 条回答
写回答
取消 提交回答
  • 语法错误

    2022-06-23 18:06:37
    赞同 展开评论 打赏
  • 错误提示很明显啊,语法错误

    have an error in your SQL syntax
    
    2021-10-12 15:28:21
    赞同 展开评论 打赏
  • 喜欢技术,喜欢努力的人

    select * from dg_taobao_cat where cid=xxxx order by cid desc
    把xxx先补全了
    但是cid=具体指后面排序就没什么意义了
    select * from dg_taobao_cat order by cid desc 这个也许是你要的

    2019-07-17 18:42:42
    赞同 1 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
搭建电商项目架构连接MySQL 立即下载
搭建4层电商项目架构,实战连接MySQL 立即下载
PolarDB MySQL引擎重磅功能及产品能力盛大发布 立即下载

相关镜像