[TYPO3-english] FOUND_ROWS() does not work
Vahan Amirbekyan
vamirbekyan at dgfoundation.org
Fri May 22 19:56:11 CEST 2009
I forgot to mention that
$field = 'SQL_CALC_FOUND_ROWS pages.title AS title, pages.description AS
description, pages.keywords AS keywords, pages.media AS media, pages.uid
AS uid';
Vahan Amirbekyan wrote:
> This is my code that always returns zero for $this->totalRows
> I am using 4.2.6 and am NOT using pconnect. My DB and application boxes
> are separate.
>
> $GLOBALS['TYPO3_DB']->sql_query('START TRANSACTION');
> $row = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($field, $table, $where,
> 'pages.uid', $orderBy, $limit);
> $countRes = $GLOBALS['TYPO3_DB']->sql_query("SELECT FOUND_ROWS() as
> count");
> $countRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($countRes);
> $this->totalRows = (!empty($countRow)) ? $countRow['count'] : 0;
> $GLOBALS['TYPO3_DB']->sql_query('COMMIT');
More information about the TYPO3-english
mailing list