you can use count() and sum() and other math functions in the SQL statement and add an alias, for example:
SELECT COUNT(idColumnNAme) as recordCount, SUM(priceColumn) as totalPrice FROM tableName
yes, this can be done in MySQLi recordsets also.
details on SUM and other aggregate functions can be found here:
http://www.tizag.com/mysqlTutorial/mysqlsum.php