[TYPO3-dev] Connecting to MSSQL from a extension

Xavier Perseguers typo3 at perseguers.ch
Tue Mar 16 06:43:37 CET 2010


Hi Jason,

> I am curious if it is possible to connect to a mssql database from within a extension. Basically I want to query mssql and display the results on a Typo3 page. When I try using the mssql_connect php function I just get a fatal error. I've seen the  import_mssql extension connect to mssql to export. Am I missing anything?

Basically, the rule is the same with MSSQL than with MySQL, you should not use any mssql_ function nor mysql_ function. If you want to connect to MSSQL from within a TYPO3 extension, you basically 
have two choices:

- Use DBAL* with MSSQL. Ref [1] is a tutorial to connect to MSSQL
- Use extension rvt_adodb which is a (very) lightweight implementation of DBAL (in a sense)

Official solution from TYPO3 is DBAL and I encourage you to choose this solution.

Regards

* Search for it in http://typo3.org/extensions
[1] http://xavier.perseguers.ch/en/tutorials/typo3/articles/mssql-database.html

-- 
Xavier Perseguers
http://xavier.perseguers.ch/en




More information about the TYPO3-dev mailing list