我准备用这个撕掉我的头发。
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 3.
The error occurred in [WITHHELD]: line 19
17 : WHERE FNAME = #FORM.first#
18 : AND LNAME = #FORM.last#
19 : AND PASS = #FORM.pass#
20 : </cfquery>
21 :
SQLSTATE 07002
SQL SELECT * FROM JUDGES WHERE FNAME = [WITHHELD] AND LNAME = [WITHHELD] AND PASS = [WITHHELD]
VENDORERRORCODE -3010
DATASOURCE honors
我已经阅读了一些类似的问题,其中有一些拼写错误,但我已经检查并重新检查了拼写,甚至更改了列和表名,并再次尝试。
答案 0 :(得分:6)
确保引用变量:
where FNAME = '#FORM.first#'
此外,您应该使用cfqueryparam
来防范SQL injection attacks:
where FNAME = <cfqueryparam value="#FORM.first#" cfsqltype="CF_SQL_VARCHAR">
(请注意,使用cfqueryparam
时)不需要引号
cfqueryparam
documentation cfqueryparam