Open the PHP configuration file php. ini, find; extensionphp_mssql.dll, remove the semicolon, 2. find mssql. change secure_connectionOff to mssql. se... open the PHP configuration file php. ini, find; extension = php_mssql.dll, remove the semicolon, 2. find mssql. secure_connection = Off to mssql. secure_connection = On, 3. set php_mssql.dll and ntwdblib in the PHP folder. DLL files are copied to the C: windowssystem32 folder.
Here, copying ntwdblib. dll to c: windowssystem32 fails because the dll file already exists in the directory. restart 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 ";