Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cfoutput from a query created with cfscript

I'm late to the party by trying to catch up on cfscript syntax. I've created a simple query in cfscript that executes and dumps out the correct data just fine:

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());

Gives me exactly what I expect. However, in the actual page

<cfoutput query="qryPositive">

throws an error that it's not defined.

like image 516
Steve Avatar asked Jun 25 '26 15:06

Steve


1 Answers

Add getResult() after execute()

qryPositive = qPositive.execute().getResult();   
like image 197
Steve Avatar answered Jun 29 '26 01:06

Steve



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!