Function to query MySQL

I use CFSCRIPT to define my query:

<cfscript>
	query name="qry"
{
	echo("select username, logondate, logontime from tblusers");
}
</cfscript>

and then CFOUTPUT to get the result into my HTML table

<cfoutput query = "qry">
            <tr class="sysusers" id="sysusers">            
              <td id = "selectuser" class="user">#qry.username#</td>
              <td class="date">#qry.logondate#</td>
              <td class="time">#qry.logontime#</td>        
            </tr></cfoutput>

Now I need to update the DB if a button is clicked but that would require a function and I can’t seem to put these in a function. There must be a way to do it.

this (and others you have posted) are pretty basic questions, have you gone thru some cfml tutorials?

happy to help, but out of respect for everyone else on this mailing list, it would be good if you study up first, there are lots of great resources for learning cfml and programming out there

Zackster,: Sound advice! Trust me, I spend a lot of time reading info on the web and delving into CFML tutes but I find the lack of examples, or at least those I can understand makes life difficult. I usually only post when my frustration is preventing me moving forward. What seems basic to the experienced is not basic to me.