[TYPO3-english] Is this a fullQuoteStr mistake?

Dmitry Dulepov dmitry at typo3.org
Mon Apr 6 08:52:16 CEST 2009


Hi!

Luming Xing wrote:
> I have some troube in following code, No result is returned.  how sould i
> do, Is there any mistake in SQL LIKE field? or a fullQuoteStr mistake?
> 
> Thank you for all help!
> 
>         $res=$GLOBALS['TYPO3_DB']->exec_SELECTquery(
>           '*',   #select
>           'tx_romoduxing_module', #from
> 
> 'modul_name='.$GLOBALS['TYPO3_DB']->escapeStrForLike($this->piVars['modul_name'],
> 'tx_romoduxing_module'),

You use '=' with escapeStrForLike. You should use '=' with fullQuoteStr.

>           #'modul_name like
> \'%'.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->piVars['modul_name'],
> 'tx_romoduxing_module').'%\'',

You use 'LIKE' with fullQuoteStr. You should use escapeStrForLike instead.

-- 
Dmitry Dulepov
In TYPO3 blog: http://dmitry-dulepov.com/article/google-analytics-certified.html
Twitter: http://twitter.com/dmitryd
Skype: liels_bugs


More information about the TYPO3-english mailing list