[TYPO3] Typo3 coding standards

Francois Suter fsuter at cobweb.ch
Sun Aug 10 12:55:06 CEST 2008


Hi,

> I have used functions *mysql()* and *mysql_fetch_array()* in my plugin. Do i
> have to use  *exec_SELECTquery<http://www.typo3-unleashed.net/typo3apidocs/typo3api_4.0.0/html/de/d07/classt3lib__DB.html#7b17306626fbf95a27cf7c854cfba59a>
> * () or above functions are ok.

Indeed you shouldn't use mysql* functions directly. Most or all of them 
are available in class t3lib_db which offers a database abstraction. A 
global instance of t3lib_db is available in $GLOBAS['TYPO3_DB'], so you 
can use statements like

$GLOBAS['TYPO3_DB']->exec_SELECTquery(...)

HTH

-- 

Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch


More information about the TYPO3-english mailing list