If PHP and MySQL are connected, the link between PHP and MSSQL is actually very simple;

Source: Internet
Author: User

 

 

If PHP and MySQL are connected, the link between PHP and MSSQL is actually very simple;
Local and remote connections of MSSQL are supported. Take the local link as an example:
Ms sqlserver 2005 is installed on the machine;
PHP needs to be configured:
1. First, ms SQL client tools is a DLL calledNtwdblib. dll, which is usually copied to the System32 folder of the system after ms SQL Server is installed. If SQL Server is installed locally, You need to verify thatThe ntwdblib. dll version is the same as the SQL Server version (2005 corresponds to 2000.80.194.0, 2000 corresponds to 2000.2.8.0;) if the SQL Server is remoteCopy ntwdblib. DLL to the System32 folder of the current machine;
(A common problem here is that if PHPNtwdblib. dll> If it is later than SQL Server installationNtwdblib. dll will overwriteNtwdblib. dll. The link is prompted: the database cannot be connected.)
2. VerifyAfter ntwdblib. dllNtwdblib. dll overwritesNtwdblib. dll;
3. the ms SQL Server method is similar to that of MySQL;
As follows:

// Link to the database
$ Conn = mssql_connect ('ibm-f24b11ed1ccsqlexpress ', 'sa', '123 ');
Mssql_select_db ('labmis ', $ conn );
// Query statement
$ Query = "select * from admin ";
$ Adminresult = mssql_query ($ query );
// Output result
$ Num = mssql_num_rows ($ adminresult );
For ($ I = 0; $ I {
$ ROW = mssql_fetch_array ($ adminresult );
Echo ($ row [1]);
Echo ("
");
}
?>

It can be seen that these functions and MySQL functions are corresponding for easy use!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.