Php connection mssql database configuration and demo code _ PHP Tutorial

Source: Internet
Author: User
Php connection mssql database configuration and demo code. Open the PHP configuration file php. ini and find; extensionphp_mssql.dll and remove the semicolon. 2. locate mssql. secure_connectionOff and change it to mssql. secure_connectionOn. 3. open the PHP configuration file PHP. ini and find it. extension = php_mssql.dll and remove the semicolon. 2. find mssql. secure_connection = Off and change it to mssql. secure_connection = On. 3. copy the php_mssql.dll and ntwdblib. DLL files in the PHP folder to the C: windowssystem32 folder.

Php connection mssql database tutorial configuration and demo code
/*
Open the php configuration file php. ini and find; extension = php_mssql.dll to remove the semicolon.
2. find mssql. secure_connection = off and change it to mssql. secure_connection = on.
3. copy the php_mssql.dll and ntwdblib. dll files in the php folder to the c: windowssystem32 folder.
---- Here, copying ntwdblib. dll to c: windowssystem32 fails because the dll file already exists in the directory.

I restarted apache,

*/
$ Hostname = "10.4.250.20 ";
$ Dbuser = "hr ";
$ Dbpasswd = "946138 ";
$ Dbname = "hr ";
$ Conn = mssql_connect ($ hostname, $ dbuser, $ dbpasswd) or die ("database connection error! ");
Mssql_select_db ($ dbname, $ conn );
$ SQL = "select * from pip_staff_s where cstaffid = 'z797 '";
$ Rowset = mssql_query ($ SQL, $ conn );
$ Rowcnt = mssql_num_row ($ rowset );
Echo "rows ";
Echo $ rowset;
Echo "end ";

Bytes. 2. find mssql. secure_connection = Off and change it to mssql. secure_connection = On. 3. input the PHP file...

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.