[TYPO3-dev] External DB connection inside an extension ?

Stephane stephane.lists at gmail.com
Fri Jul 11 08:25:41 CEST 2008


Thanks Dimitry and Ernesto (and all) for this both informations.

Stephane

Ernesto Baschny [cron IT] wrote:
> Dmitry Dulepov [typo3] wrote: on 10.07.2008 19:49:
>
>   
>>> Then, in my extension, I open a new connection to my external db via 
>>> mysql_connect command. I'm able to get all necessaries datas with 
>>> queries ... no problem .. until here.
>>>
>>> The problem come just after. After this mysql_query on external db, I 
>>> don't know why but I lost the connection to Typo3 db :(.
>>>       
>> This happens in PHP if you use the same user name and password to 
>> different databases. PHP just selects another database and reuses the 
>> same connections. Normally each database must have its own user.
>>     
>
> True! And Stephane, Mauro: The reason why with AdoDB it works, is 
> because NConnect calls mysql_connect with the $new_link=TRUE parameter, 
> which defaults to "FALSE" (re-use existing link).
>
> See:
>
> http://www.php.net/mysql_connect
>
> for more details on the mysql_connect parameter $new_link.
>
> Cheers,
> Ernesto
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
>   




More information about the TYPO3-dev mailing list