[TYPO3-dev] Database connection

Stefan Henschke henschke.stefan at googlemail.com
Fri May 27 21:04:50 CEST 2011


Hi all,

I have just downloaded the current TYPO3 version with Git. (I want to 
contribute with unit tests).

The connection to the database is opened in the file $ROOT/t3lib/
class.t3lib_db from line 1169 to 1178.

There the @ operator is used, so we don't get error messages.

Example:
"$this->link = @mysql_connect($TYPO3_db_host, $TYPO3_db_username, 
$TYPO3_db_password);"

Is this right? Wouldn't it be better to use an if statement, so we check 
if the connection couldn't be established?
"if (this->link == FALSE) { ... }"

What about using mysqli or pdo?

Sincerely,

Stefan




More information about the TYPO3-dev mailing list