开发者

how to connect and configure php with sqlserver [closed]

开发者 https://www.devze.com 2023-04-13 02:46 出处:网络
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time,or an extraordinarily narrow situation that is not generally applic
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable 开发者_如何学编程to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 9 years ago.

I want to connect php with sql server and also configure php for using sql server.

Can anyone tell me step by step starting with configure php to connecting php with sql server plz help me?


Please consult the PHP manual and review the material on Mssql. This is a built-in extension that you should have available, verify by reviewing the results from <?php phpinfo(); ?>. If its not available then it may be enabled by adding extension=php_mssql.dll to php.ini. If you need more help than that then refer to the manual.

You would begin with a simple mssql_connect to connect to a MSSQL server from PHP. The rest is in the docs...

You can also review SQL Server Driver for PHP if it turns out that you can't use the Mssql extension.


It's simply just two lines!

This is an example for a MySQL server:

<?php
mysql_connect("localhost", "username", "password") or die(mysql_error());
mysql_select_db("your_db_name") or die(mysql_error());
?>

Then you can start doing queries towards your SQL server.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号