gpt4 book ai didi

php - mySQL查询有问题

转载 作者:行者123 更新时间:2023-12-01 00:26:28 28 4
gpt4 key购买 nike

我正在做一个项目,需要使用下面的查询语句,不幸的是我的表名和列名有破折号。有谁知道如何让它工作?

SELECT * FROM 'default-table' WHERE 'ds-avail'='Yes';

这是我得到的错误。

Invalid query: 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 '; SELECT * FROM [default-table] WHERE [ds-avail]='Yes'' at line 

最佳答案

试试这个

SELECT * FROM `default-table` WHERE `ds-avail` = 'Yes';

你使用了 'table' 而你应该像这样 table

关于php - mySQL查询有问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13768664/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com