Query the database using <CFQUERY>
<CFSET variables.anID = 2>
<CFQUERY NAME=“myquery” DATASOURCE=“mydatabase”>
select firstname, lastname from mytable where id = #variables.anID#</CFQUERY>
Accessing the data from the ResultSet
#myquery.firstname#
#myquery.lastname#