New method in t3lib_db allows easy execution of count SQL statement. For example: $countPages = $GLOBALS[‘TYPO3_DB’]->exec_SELECTcountRows(‘*’, ‘pages’, ‘deleted = 0’); More info: RFC: Feature Request #10091: Integrate TYPO3_DB->exec_SELECTcountRows() http://bugs.typo3.org/view.php?id=10091