Project

General

Profile

Actions

Feature #19786

closed

Integrate TYPO3_DB->exec_SELECTcountRows()

Added by Oliver Hader almost 16 years ago. Updated over 14 years ago.

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

00010091_v2.patch (1 KB) 00010091_v2.patch Administrator Admin, 2009-01-10 16:11

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #19793: Use TYPO3_DB->exec_SELECTcountRows() to determine the number of rowsClosedOliver Hader2009-01-11

Actions
Actions #1

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.

Actions #2

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 #3

Updated by Oliver Hader almost 16 years ago

Committed to SVN Trunk (rev. 4690)

Actions

Also available in: Atom PDF