0

So I have a trouble here. Tried use mssql_connect() but interpeter says that function is undefinied. PHP.net advices this, but it suppports only older versions of PHP. Is it possible to connect to MS SQL Server database from PHP5.6? What extensions should I add, what functions can I use?

Configuration details: localhost, Apache 2.4, PHP 5.6, OS Windows 8.

2 Answers 2

1

You need to enable the MSSQL extension in the PHP.ini file.

If this extension is not installed, you need to install it in PHP.

Please tell your server details (OS/WebServer like apache nginx) so that I can explain in detail.

Sign up to request clarification or add additional context in comments.

6 Comments

Generally I know how to add extensions to php.ini, but Microsoft released extensions only for PHP 2.2-2.4. I use Apache 2.4 on localhost
localhost? You are using Windows or Linux?
XAMPP or WAMP server? or you installed Apache and PHP on your own?
First you need to install this extension dll in PHP then enable the extension from php.ini
I installed manually PHP and Apache. What extension should I use if Microsoft gives only extensions for PHP5.3 and PHP5.4?
|
0

Use

 <?php phpinfo();?>

to see what are available with your php installation. I advice you to use PDO instead of mysql_* functions. It supports several databases not only MSSQL or MySQL.

6 Comments

mysql_* functions are not used, mssql_* functions are used.
What do you mean by mysql_* are not used? One who uses mysql use mysql_* functions, mssql users may use mssql_* functions. What is wrong with this answer?
He asked in the question Tried use mssql_connect() not mysql
I only suggested to not use mysql_ or mssql_ functions. Instead use pdo which provides support for several databases.
Can u give me please the link where I can download the extension?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.