Sign in to follow this  

[web] PHP + MSSQL Server

This topic is 4864 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I wasn't sure where to post this question, but I figured since it was General programming..to put it in here.. Ok, I'm trying to connect to a MSSQL server, through PHP, but it seems the web server that i'm using, doesn't have the MSSQL server libs or whatever installed (or something) I get the function not found error when I try to use mssql_connect(); I looked into the phpinfo() and found nothing about mssql server, only mysql... Is there a way around this? A way that I could connect to the database..maybe through oledb? or something? Maybe ASP? does ASP have the same problems that PHP does? (as in you must have certain things installed in order to connect to a sql server database) Thanks for you're guys help, and if this is the wrong place to post such a question, please let me know the right place.. Thanks kag1

Share this post


Link to post
Share on other sites
Are you able to set up a DSN to the server? If you can, use that.

Using SQLServer connections via ASP/ASP.NET is pretty trivial. Just use an ADODB connection string.

As for php, I really don't know. As far as I was aware, the main use of php is with MySQL. It would be possible to use MSSQL if you can use an ODBC driver that supports MS SQL (DB_mssql, I think?) - but if your host doesn't support it you're screwed.

Oh, and the best place for this question would have been the Web Development forum [wink]

Share this post


Link to post
Share on other sites
You need to load MSSQL extension into PHP.
Open your php.ini, find ;extension=php_mssql.dll and remove the ";" in the beginning of the line.
Be sure that php_mssql.dll is in your php extensions dir and your php.ini is right configured to load extensions.

Share this post


Link to post
Share on other sites
Hmm, Would I be able to create a DSN programmically? The problem is, The Web Server is on one server, and the SQL server, is on another

Share this post


Link to post
Share on other sites

This topic is 4864 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this