Actions
Feature #19786
closedIntegrate TYPO3_DB->exec_SELECTcountRows()
Status:
Closed
Priority:
Should have
Assignee:
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2009-01-10
Due date:
% Done:
0%
Estimated time:
PHP Version:
5.2
Tags:
Complexity:
Sprint Focus:
Description
In the TYPO Core counting rows is/was implemented as the following:
- get result set for a "COUNT" query, fetch row, free result set (not in all cases)
- get result set for a regular table SELECT, get sql_num_rows, free result set (not in all cases again)
To simplify this, it would be nice, to have an accordant method in the database API that takes care of counting rows.
There was a discussion in the dev-list some months ago and Masi had the idea to introduce such a function in TYPO3_DB, read the thread here:
http://support.typo3.org/general/dev/m/typo3-dev-tip-use-sql-function-count-354264/p/234/
(issue imported from #M10091)
Files
Updated by Oliver Hader almost 16 years ago
Attached is a patch that implements TYPO3_DB->exec_SELECTcountRows($table, $where = '').
It's not required to put it to DBAL since DBAL extends t3lib_DB and the new method introduced with this issue calls available methods that get overridden in DBAL.
Updated by Oliver Hader almost 16 years ago
The attached new patch adds the possibility to define the field used in the COUNT expression.
Actions