[Typo3-dev] Connecting to a different db kills typo3 db connection?

Dmitry Dulepov typo3 at fm-world.ru
Mon Aug 1 12:53:01 CEST 2005


Hi!

This explains everything :) Since TYPO3_db is defined to an empty
string, the last active database is used... Thus any extension that uses
mysql() function cannot be safely used with multiple databases.

Thanks a lot!

Dmitry.

Rainer Kuhn wrote:
> Dmitry Dulepov wrote:
> 
>> I could not find 'mysql' function definition neither in typo3, nor in
>> php. What can it be?
> 
> 
> Hi Dmitry,
> 
> AFAIK mysql($typo3_db, $query) is an old function of php2
> (http://museum.php.net/php2/). This is from the php-2.0 doc:
> 
> <snip>
> 
> $result = mysql($database,$query)
> 
> mysql sends a mysql query. Arguments are the database name and the query
> string. ie. <?mysql("MyDatabase" , "select * from table")>. The return
> value from this function is a result identifier to be used to access the
> results from the other mysql_ functions. A result identifier is a
> positive integer. The function returns 0 when no result identifier is
> created. This is the case with any queries that do not return anything,
> such as create, update, drop, insert and delete. The function will
> return -1 if an error occurs. A string describing the error will be
> placed in $phperrmsg, and unless the function was called as @mysql()
> then this error string will also be printed out. This function is only
> available if mysql support has been enabled in PHP.
> 
> </snip>
> 
> 
> Cheers,
> Rainer




More information about the TYPO3-dev mailing list