I'm trying to perform an SQL COUNT on my database using AJAX thru a cfc file, however, I have no clue how to get the return variable. The cfc file is as follows
<cffunction name="getSpeakerCount" access="remote" returntype="query">
<cfargument name="AID" required="true" type="string">
<cfquery name="getSpeaker" datasource="SpeakerCard">
SELECT COUNT(AID)
FROM tbl_SpeakerCard_Log
WHERE AID = '#AID#'
</cfquery>
<cfreturn getSpeakerCount>
</cffunction>
My ajax is along the lines of this... I'm not sure how to properly call/use it.
for (var i = 0; i < X; i++)
{
$.ajax('actions/AgendaList.cfc?wsdl', {method : 'getSpeakerCount', AID: AgID, dataType:
"text", type: 'get', success: function(data)
{
SCount[i] = data;
}
}});
This always returns all the elements in SCount[i] as undefined. I'm not sure how to get the count return from the cfc... Any help is appreciated!