Coldfusion 使用cfscript创建的查询的cfoutput
我试图赶上cfscript语法,所以晚会迟到了。我在cfscript中创建了一个简单的查询,可以很好地执行和转储正确的数据:Coldfusion 使用cfscript创建的查询的cfoutput,coldfusion,cfml,Coldfusion,Cfml,我试图赶上cfscript语法,所以晚会迟到了。我在cfscript中创建了一个简单的查询,可以很好地执行和转储正确的数据: qPositive = new Query(datasource="#APPLICATION.DSN#"); qPositive.setSQL(" my sql here "); qPositive.addParam(name="xid",value="178",CFSQLTYPE="CF_SQL_INT"); qryPositive = qPositive.execut
qPositive = new Query(datasource="#APPLICATION.DSN#");
qPositive.setSQL(" my sql here ");
qPositive.addParam(name="xid",value="178",CFSQLTYPE="CF_SQL_INT");
qryPositive = qPositive.execute();
writeDump(qryPositive.getResult());
这正是我所期望的。但是,在实际页面中
<cfoutput query="qryPositive">
抛出未定义的错误 在execute()之后添加getResult()
您使用的是什么版本的ColdFusionnew Query
在较新版本中已被替换为QueryExecute()
正如您在下面所说的,您必须使用getResult()
才能使查询结果实际存在。由于这些是可链接的,我通常只会自动链接x.execute().getResult()
。我认为execute()
本身不会为您提供很多信息。
qryPositive = qPositive.execute().getResult();