<<: back to overview
Get SQL-Query from exec_SELECTquery
from Martin Holtz posted at 2008-08-11, Language: php

Submitting your vote...
Rating: 4.8 of 5. 4 vote(s).
Click the rating bar to rate this item.
Tags: mysql, sql, TYPO3_DB, globals, store_lastBuildQuery, debug_lastBuildQuery, exec_SELECTquery, debug
There is a build in function which stores the last SQL-Statement which is created via $GLOBALS['TYPO3_DB']->exec_*query
$GLOBALS['TYPO3_DB']->store_lastBuiltQuery = 1;
// process query
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($select_fields,$from_table,$where_clause,$groupBy,$orderBy,$limit);
// the complete SQL-Statement
echo $GLOBALS['TYPO3_DB']->
debug_lastBuiltQuery;