foundeo / cfdocs

Repository for the cfdocs.org site.

Home Page:https://cfdocs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cfqueryparam

Wolfgang-Falk opened this issue · comments

As a newcomer to CFML this past year, it was difficult to understand cfqueryparam for cfscript. However, as some research, I noticed the documentation for queryExecute() provides ample examples of cfqueryparam statements in cfscript.

For instance, this example is available now on the queryExecute() page.

qryResult = queryExecute("SELECT * FROM Employees WHERE empid = :empid AND country = :country", {country={value="USA", cfsqltype="cf_sql_varchar"}, empid={value=1, cfsqltype="cf_sql_integer"}});

As it stands currently, besides the two first examples being array-based, the only example in cfscript for cfqueryparam is with one cfqueryparam provided.

I recommend duplicating this example in the cfqueryparam documentation to have an example using multiple cfqueryparam statements and reorganize the array-based examples below the singular and multiple options. That way, when learning cfqueryparam, a developer can see the progression from simple to more complex examples.

I realize now that I can contribute via forking it and submitting it. My apologizes. I'll make a pull request to aid the documentation on the cfqueryparam.

Thanks @Wolfgang-Falk - I agree it is always better to have simpler examples first and work your way down to the more complicated ones.