SQL 查询抛出此错误:
SQL Query throwing this error:
您的 SQL 语法有错误;检查手册对应于您的 MySQL 服务器版本以使用正确的语法靠近第 1 行的 ''
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 '' at line 1
无法找到它在谈论什么,因为它只给我 '' 而不是查询中的任何文本.谢谢!
Can't find what it is talking about as it only gives me '' and not any text in the query. Thanks!
推荐答案上面的字符串拼接看起来真的很乱!我会去做一些简单的事情:
The string concatenation above looks really messy! I would go for something simple:
$sql = "更新 $tablename SET stock='$stock' WHERE itemname='$itemname'";
如果这不起作用,您应该调试以下值:$tablename, $stock 和 $itemname
If this doesn't work, you should debug the values of : $tablename, $stock and $itemname
ps.我已经给尼克 +1 了 :)
ps. I've already given +1 to Nick :)
更多推荐
'' 附近的 SQL 查询错误
发布评论