mssql_connect not working

A

Anonymous

Guest
Hi,
Sound likes there is no driver loaded. I'm not familiar with the requirements of mssql, but a quick google shows that you might want to be using the newer sqlsrv_xxx function (e.g. sqlsrv_connect instead of mssql_connect).

If you are getting 'undefined function' then you haven't got that extension loaded. I suggest you check what drivers / extensions you HAVE got loaded. Do a simple page with just a phpinfo() call - it will print out lots of stuff about your php environment. If there is no mention of anything Sql-Server, then you haven't got any SqlServer stuff.
Code:
<?php
phpinfo();
?>
Once the undefined function bit dissapears, the real problem is usually getting the right connection string.
-A
 
phpcrazyfan said:
extension=php_sqlsrv_56_ts.dll
So, have I been attempting the wrong command this whole time?
Yes. Notice how the phrase 'sqlsrv' relates the extention name 'php_sqlsrv_56_ts.dll' to the function call prefix for 'sqlsrv_connect'. This is quite common in php.

phpcrazyfan said:
This extension requires the Microsoft ODBC Driver 11 for SQL Server.
I've not used the sql server drivers, but it is not surprising that MS wants to use ODBC, so if that's what it takes, load it...

phpcrazyfan said:
sqlsrv support enabled
This is the phrase you are looking for that tells you that the extention you loaded with 'extention=xxx' is, in fact, loaded.

phpcrazyfan said:
From these 4 options, which one should I use?
SQLSRV32.EXE
The numbers are version numbers, so 32 is version 3.2 and hence the highest version of the list you gave.
- A
 
Back
Top