Forum Moderators: coopster
Well I am setting up my clients database with PHP and MSSQL. I was using MySQL, but now our hosting company doesn't support MySQL so I am having to use it instead. I can't seem to connect to the DB. I have used the mssql_connect instead of mysql_connect but I get this error:
PHP Fatal error: Call to undefined function: mssql_connect() in db_config.php on line 2.
The hosting company seems to be a pain in the butt to deal with for tech support so if this is an error on my side I would rather resolve it without having to contact them.
Thanks for your help :)
Wes
[ca2.php.net...]
Requirements for Win32 platforms.The extension requires the MS SQL Client Tools to be installed on the system where PHP is installed. The Client Tools can be installed from the MS SQL Server CD or by copying ntwdblib.dll from \winnt\system32 on the server to \winnt\system32 on the PHP box. Copying ntwdblib.dll will only provide access. Configuration of the client will require installation of all the tools.
Requirements for Unix/Linux platforms.
To use the MSSQL extension on Unix/Linux, you first need to build and install the FreeTDS library. Source code and installation instructions are available at the FreeTDS home page: [freetds.org...]
Note: In Windows, the DBLIB from Microsoft is used. Functions that return a column name are based on the dbcolname() function in DBLIB. DBLIB was developed for SQL Server 6.x where the max identifier length is 30. For this reason, the maximum column length is 30 characters. On platforms where FreeTDS is used (Linux), this is not a problem.
Installation
The MSSQL extension is enabled by adding extension=php_mssql.dll to php.ini.
To get these functions to work, you have to compile PHP with --with-mssql[=DIR], where DIR is the FreeTDS install prefix. And FreeTDS should be compiled using --enable-msdblib.
try uploading a file that contains this
<?php
phpinfo(); [ca2.php.net]
?>
then call it in your browser and see if it even says anything about mssql enabled.