[TYPO3-english] TYPO3_DB on TYPO3 v. 4.6.1
Jigal van Hemert
jigal at xs4all.nl
Sun Dec 11 16:35:39 CET 2011
Hi,
On 11-12-2011 14:52, Jeppe Donslund wrote:
> Fatal error: Call to undefined method t3lib_DB::sql() in ...
> Are there any changes in TYPO3 v. 4.6.1? It is the first time I use that
> version.
As Steffen indicated, sql() is removed in 4.6.0 and turned up in your
deprecation log since version 4.4 ...
> I use this code:
>
> $query = $GLOBALS['TYPO3_DB']->SELECTquery(
> '*', // SELECT ...
> 'tx_jdtttrash_trash', // FROM ...
> 'deleted = 0 AND hidden = 0', // WHERE...
> '', // GROUP BY...
> 'tstamp', // ORDER BY...
> '' // LIMIT ...
> );
>
> $res = $GLOBALS['TYPO3_DB']->sql(TYPO3_db, $query);
Quickest fix:
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'*', // SELECT ...
'tx_jdtttrash_trash', // FROM ...
'1=1' . $this->cObj->enableFields('tx_jddttrash_trash'), // WHERE...
'', // GROUP BY...
'tstamp', // ORDER BY...
'' // LIMIT ...
);
If you are in a BE module use
'1=1' . t3lib_BEfunc::deleteClause('tx_jdtttrash_trash') .
t3lib_BEfunc::BEenableFields('tx_jdtttrash_trash'), // WHERE...
These functions will add the proper hidden/deleted/fe_group/etc. checks
as configured in TCA
> while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
> $content = '<div class="box">'.$row["title"].'</div>';
> }
--
Kind regards / met vriendelijke groet,
Jigal van Hemert.
More information about the TYPO3-english
mailing list