Hi, hoping someone maybe able to point me in the right direction.
Currently I have a query returning results to a template using the following LatestResources method
$sqlQuery = new SQLQuery();
$sqlQuery->selectField("field1, field2")
...
$result = $sqlQuery->execute();
The results are then pushed onto an ArrayList
...
foreach($result as $row) {
$returnedRecords->push(new ArrayData($row));
}
...
and the results are displayed in the template using a control.
What I want to know is how to also return the number of rows with the data. I can get the number of rows using:
...
$result = $sqlQuery->execute();
$result->numRecords();
...
The question being how can I get this and my data out into my template without having to query the database again just to get the number of rows.
Hope someone can help
Thanks