PHP remote connection to MSSQL

Source: Internet
Author: User
You need to use JOOMLA to connect MSSQL to another server. The PHP environment is aperv (apache2.2.4, 5.2.3) in windows. Remove the & quot; in front of the line below php. ini .; Search for the NTWDBLIB. DLL file in extensionphp_mssql.dll, which is usually in the C: windowssystem32 and PHP installation folders. Right-click the attribute to view the version. For version 2000.80, you need to use JOOMLA to connect to the MSSQL of another server. The PHP environment is aperv in windows (apache2.2.4, 5.2.3)

Remove the ";" sign in front of the line below in php. ini.

;extension=php_mssql.dll

Search for the NTWDBLIB. DLL file, usually in the C: windowssystem32 and PHP installation folders. Right-click Properties to view the version. if the version is earlier than 2000.80.194.0, it must be updated.

After the service is restarted, it is found that the local MSSQL is OK and the remote connection fails. I found N multiple websites. The answer is basically NTWDBLIB. DLL. However, the connection fails.

In a local test today, the environment is XAMPP1.7.0 in windows. We found that Apachebin also contains the NTWDBLIB. DLL file, but apache in appserv on the server does not. Replace it with that the connection is successful.

Conclusion: appserv does not support MSSQL remote connection. apache is much easier than XAMPP, as can be seen from the number of files.

PHP functions about MSSQL:

Mssql_affected_rows :??? Obtain the number of columns affected by the last query.

Mssql_close :??? Close the connection.

Mssql_connect :??? Connect to the database.

Mssql_data_seek :??? Move the column pointer.

Mssql_fetch_array :??? Returns an array of data.

Mssql_fetch_field :??? Obtain field information.

Mssql_fetch_object :??? Class data.

Mssql_fetch_row :??? Return fields in a single column.

Mssql_field_seek :??? Configure a pointer to a field returned value.

Mssql_free_result :??? Release the returned memory usage.

Mssql_num_fields :??? Obtain the number of returned fields.

Mssql_num_rows :??? Obtain the number of returned columns.

Mssql_pconnect :??? Open ms SQL Server persistent connection.

Mssql_query :??? Returns a query string.

Mssql_result :??? Obtain the query result.

Mssql_select_db :??? Select a database.

GB2312 to UTF-8 function (otherwise ):
iconv("gb2312","utf-8",$text)

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.