I have a Coldfusion Component which returns my search results from a query in JSON using serializeJSON(myquery).
The results returned dont have the ROWCOUNT before the COLUMNS, if i do return the results with the ROWCOUNT then it messes everything up.
What is the best way to display the recordcount without using the ROWCOUNT value?
Unless there is something you are not telling us, you do not need to include an extra row count. It can be derived from the result.
By default
serializeJSON(queryObject)
returns a structure with two keys:DATA
andCOLUMNS
(both arrays).DATA
represents the rows in the query. So to obtain the query row count, simply check the length of theDATA
array.