MySQL query error with a table named “order”

后端 未结 1 933
名媛妹妹
名媛妹妹 2021-01-22 09:21

I have this problem but I just found out the solution so I\'ll write it here anyway in case anyone stumbles in it. This is my mysql query:

mysql_query(\"SELECT id

1条回答
  •  南方客
    南方客 (楼主)
    2021-01-22 10:07

    Order is reserved Word. You have to use like Enclose ORDER in back-ticks.

    Try this

    mysql_query("SELECT id FROM `order` ORDER BY id DESC LIMIT 1")
    

    Reserved Words

    0 讨论(0)
提交回复
热议问题