[TYPO3] mysql function

Dmitry Dulepov [typo3] dmitry at typo3.org
Thu Nov 29 09:58:41 CET 2007


Hi!

Nino Katic wrote:
> Dmitry, thx. for reply. Now i see why it is not working as it should :-) I'm 
> using aliaspro extension with Typo3 ver. 3.8.1 (i know it is old). and this 
> extension is using mysql function to execute mysql queries. Can you give me 
> advice what function to use instead so i can try to modify this extension. 
> Maybe those functions found in typo3/t3lib/class.t3lib_db.php ? Thx.

If I remember correctly, mysql() function accepts database name and query. You can change it to $GLOBALS['TYPO3_DB']->sql_query($query). This is the easiet way. $GLOBALS['TYPO3_DB'] is an instance of t3lib_db, it is a wrapper for mysql functions and it is connected to current TYPO3 database. You can also look at $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(). Its syntax is more complex but it returns you all rows (good if you do not have to select 1000 rows at once) and it is my favorite for small results :)

-- 
Dmitry Dulepov
TYPO3 core team
Web: http://typo3bloke.net/
Skype: callto:liels_bugs


More information about the TYPO3-english mailing list