关于<cfquery>中单引号变双引号问题
<cfset list1="SELECT * FROM computer_info_view where os_language='CH'; and os_name='Windows2000' and version='PRO';">
<cfquery name="sel_list" datasource="#ds#">
#list1#
</cfquery>
运行后...
Error Executing Database Query.
[Macromedia][SQLServer JDBC Driver][SQLServer]Line 1: Incorrect syntax near 'CH'.
SQL : SELECT * FROM computer_info_view where os_language=''CH''; and os_name=''Windows2000'' and version=''PRO'';
单引号全变成双引号?
[解决办法]
使用:PreserveSingleQuotes()函数,问题已解决。
[解决办法]
帮你结帖:)