[TYPO3] Error in SQL with $GLOBALS['TYPO3_DB']->SELECTquery

Stephen Bungert s.bungert at metrinomics.de
Fri Jun 6 16:59:07 CEST 2008


This works:


$query = $GLOBALS['TYPO3_DB']->SELECTquery(
		    '*',
		    'tx_metri_secure_log',
		    'website=' .
$GLOBALS['TYPO3_DB']->fullQuoteStr('fmf.stephen.local',
'tx_metri_secure_log'),
		    '',
		    $this->sortOrder,
		    $this->dlLimit
		    );

But previously I used 

		    'website=' . t3lib_DB::fullQuoteStr('fmf.stephen.local',
'tx_metri_secure_log'),

And this generated a my_sql error.

Warning: mysql_real_escape_string() expects parameter 2 to be resource, null
given in /srv/http/default/htdocs/t3lib/class.t3lib_db.php on line 554

I guess in the backend t3lib_DB::fullQuoteStr doesn't work maybe? Any way
using $GLOBALS['TYPO3_DB']->fullQuoteStr works.

Thanks fort he advice Demitry. I shall go through my other extensions and
see if I have made similar mistakes.


-----Ursprüngliche Nachricht-----
Von: typo3-english-bounces at lists.netfielders.de
[mailto:typo3-english-bounces at lists.netfielders.de] Im Auftrag von Dmitry
Martynenko
Gesendet: Freitag, 6. Juni 2008 16:28
An: TYPO3 English
Betreff: Re: [TYPO3] Error in SQL with $GLOBALS['TYPO3_DB']->SELECTquery

Hi Stephen,

SB> SELECT *
SB> FROM tx_metri_secure_log
SB> WHERE
SB> website=fmf.stephen.local
SB> ORDER BY tstamp DESC
SB> LIMIT 10

You must include website name in qoutes!

-- 
Dmitry Martynenko
Developer

Web: http://realt.by

_______________________________________________
TYPO3-english mailing list
TYPO3-english at lists.netfielders.de
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english



More information about the TYPO3-english mailing list