删除错误:'where子句'中的未知列(Delete Error: Unknown Column in 'where clause')
在学校项目的数据库上工作。 我已成功地在我的数据库的其他部分使用了以下基本的PHP代码行(当然为其他表和值修改):
$sql = "DELETE FROM Rank WHERE RankAbb=" . $_REQUEST["RankAbb"];表名是Rank列名是RankAbb RankAbb中的值是VARCHAR(10)
到目前为止,这行代码对CHAR和IT值起作用。
我在每个元组旁边都有一个超链接的“删除”按钮,您可以在其中单击该链接,它会引用此代码,并从表中删除它。
RankAbb PayGrade FullRank 1stLt O-2中尉DELETE EDIT
如果我单击DELETE链接,我会收到以下错误:
错误:DELETE FROM Rank WHERE RankAbb = 1stLt'where clause'中的未知列'1stLt'
我已经达到了有效排除故障和分解问题的能力。 有人可以帮忙吗?
Working on a database for a school project. I have used the following basic line of PHP code in other parts of my database with success (modified for other tables and values of course):
$sql = "DELETE FROM Rank WHERE RankAbb=" . $_REQUEST["RankAbb"];Table name is Rank Column name is RankAbb Value in RankAbb is a VARCHAR(10)
This line of code has worked so far on CHAR and IT values.
I have a hyperlinked 'DELETE' button next to each tuple where you should be able to click the link, it references this code, and deletes it from the table.
RankAbb PayGrade FullRank 1stLt O-2 First Lieutenant DELETE EDIT
If I click on the DELETE link I get the following error:
Error: DELETE FROM Rank WHERE RankAbb=1stLt Unknown column '1stLt' in 'where clause'
I've reached my capacity to effectively troubleshoot and decompose the problem. Can anyone help?
最满意答案
您需要将值包装在引号中。 这可以解决您的初始问题。 但为了避免将来出现问题,请参阅Jay Blanchard的评论。
$sql = "DELETE FROM Rank WHERE RankAbb='" . $_REQUEST["RankAbb"] . "'";You need to wrap the value in quotes. This fixes your initial problem. But to avoid problems in the future see Jay Blanchard's comment.
$sql = "DELETE FROM Rank WHERE RankAbb='" . $_REQUEST["RankAbb"] . "'";#感谢您对电脑配置推荐网 - 最新i3 i5 i7组装电脑配置单推荐报价格的认可,转载请说明来源于"电脑配置推荐网 - 最新i3 i5 i7组装电脑配置单推荐报价格
下一篇:vim编辑器使用
推荐阅读
留言与评论(共有 20 条评论) |
本站网友 女子不孕 | 6分钟前 发表 |
它会引用此代码 | |
本站网友 王丁 | 11分钟前 发表 |
您可以在其中单击该链接 | |
本站网友 番禺租房网 | 19分钟前 发表 |
有人可以帮忙吗? Working on a database for a school project. I have used the following basic line of PHP code in other parts of my database with success (modified for other tables and values of course) | |
本站网友 北京军海癫痫专科 | 25分钟前 发表 |
请参阅Jay Blanchard的评论 | |
本站网友 蜂蜜排毒 | 1分钟前 发表 |
RankAbb PayGrade FullRank 1stLt O-2中尉DELETE EDIT 如果我单击DELETE链接 | |
本站网友 皇甫嵩 | 30分钟前 发表 |
删除错误:'where子句'中的未知列(Delete Error | |
本站网友 时间煮雨歌词 | 1秒前 发表 |
我会收到以下错误: 错误:DELETE FROM Rank WHERE RankAbb = 1stLt'where clause'中的未知列'1stLt' 我已经达到了有效排除故障和分解问题的能力 | |
本站网友 双神吧 | 7分钟前 发表 |
我已成功地在我的数据库的其他部分使用了以下基本的PHP代码行(当然为其他表和值修改): $sql = "DELETE FROM Rank WHERE RankAbb=" . $_REQUEST["RankAbb"]; 表名是Rank列名是RankAbb RankAbb中的值是VARCHAR(10) 到目前为止 | |
本站网友 中国康网 | 6分钟前 发表 |
Unknown Column in 'where clause') 在学校项目的数据库上工作 | |
本站网友 大商网 | 30分钟前 发表 |
DELETE FROM Rank WHERE RankAbb=1stLt Unknown column '1stLt' in 'where clause' I've reached my capacity to effectively troubleshoot and decompose the problem. Can anyone help? 最满意答案 您需要将值包装在引号中 | |
本站网友 大连船舶重工 | 12分钟前 发表 |
请参阅Jay Blanchard的评论 | |
本站网友 卢米埃影城 | 1秒前 发表 |
这行代码对CHAR和IT值起作用 | |
本站网友 哪个牌子的奶粉好 | 1秒前 发表 |
Unknown Column in 'where clause') 在学校项目的数据库上工作 | |
本站网友 阿尔法go | 7分钟前 发表 |
它会引用此代码 | |
本站网友 神州半岛喜来登度假酒店 | 21分钟前 发表 |
并从表中删除它 | |
本站网友 铁路涨工资 | 17分钟前 发表 |
并从表中删除它 | |
本站网友 getparameter | 14分钟前 发表 |
它会引用此代码 | |
本站网友 任丘传奇 | 17分钟前 发表 |
但为了避免将来出现问题 | |
本站网友 如何去掉妊娠纹 | 13分钟前 发表 |
它会引用此代码 |