【发布时间】:2014-06-06 16:53:09
【问题描述】:
我知道这应该是一个非常简单的解决方法,但我就是找不到语法错误。我正在使用一个框架,它将? 字符替换为我传递给它的值,所以"?" % "mytable" -> "'mytable'",很简单吧?
我正在发送字符串
"select * from ? limit ?;" % ("assays", 10)
我收到语法错误:
"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 ''assays' limit 10' at line 1"
我觉得我错过了一些非常简单的东西。
感谢您的帮助。
【问题讨论】:
-
@juergend 它传入
"assays"到第一个?和10到第二个?