gpt4 book ai didi

mysql - [42S22][1054] 'where clause' 中的未知列

转载 作者:行者123 更新时间:2023-11-29 01:41:03 24 4
gpt4 key购买 nike

我有一个语句在 PHP 中工作正常,但是当我在 MySQL 控制台中尝试它时,我得到一个错误:

sql> UPDATE users SET password = ? WHERE username = ?
(?=Test, ?=test)
[2014-03-07 17:26:31] [42S22][1054] Unknown column 'test' in 'where clause'

我试过用引号括起 ? 和许多其他选项。

它应该是一个简单的WHERE,但它在控制台中似乎不起作用。

这让我觉得这是一个错误的 SQL 请求,但我无法找出它有什么问题。

最佳答案

你需要用引号将你的字符串括起来,所以使用

(?='Test', ?='test')

否则 mysql 会将它们视为实际上不存在于您的表中的列

关于mysql - [42S22][1054] 'where clause' 中的未知列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22262741/

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