My first attempt at using a query inside a cfscript tag
My first attempt at this is not going well.
Here's what I have:
<cfscript>
function calbox(topic) {
queryService = new query();
queryService.setDatasource("hepoffice");
queryService.setName("getevents");
queryService.addParam(name="topic",value="arguments.topic",cfsqltype="cf_sql_numeric");
result = queryService.execute(sql="SELECT event_title" &
", event_desc" &
", event_start_date" &
", event_url" &
", exit_door" &
"FROM events" &
"INNER JOIN pagetopics" &
"ON pagetopics.topic_id = events.event_topic" &
"WHERE pagetopics.topic_id = :topic");
}
</cfscript>
When I view a page that has this code block on it, I get the following error:
Invalid CFML construct found on line 29 at column 28.
ColdFusion was looking at the following text:
query
The CFML compiler was processing:
A script statement beginning with queryService on line 29, column 9.
A script statement beginning with function on line 28, column 1.
A cfscript tag beginning on line 27, column 2.
This isn't where I expected to get an error. Anyone have any idea where I've gone wrong?