// Execute the query.
countCookiesQuery.exec();
+ // Move to the last row.
+ countCookiesQuery.last();
+
// Initialize a number of cookies variable.
int numberOfCookies = 0;
// Check to see if the query is valid (there is at least one cookie).
if (countCookiesQuery.isValid())
{
- // Move to the last row.
- countCookiesQuery.last();
-
// Get the number of rows (which is zero based) and add one to calculate the number of cookies.
numberOfCookies = countCookiesQuery.at() + 1;
}