如何在 ColdFusion 中编写区分大小写的查询?我希望用户名和密码区分大小写。这就是我所拥有的:
<cfquery datasource="myDataSource" name="qVerify">
SELECT *
FROM tblUsers
WHERE userName = '#userName#'
AND password = '#password#'
</cfquery>
<cfif qVerify.RecordCount>
<cfset session.allowin = "True" />
<cfset session.ID = qVerify.ID />
{ "login" : "valid" }
<cfelse>
{ "login" : "invalid" }
</cfif>
因此,如果用户 Dave(因为它在数据库中)以 dave 身份登录,它将无效......