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...