PHP connection to SQL Server

Source: Internet
Author: User
1. Configure the php.ini (if it is phpnow, it may be apache2handler.ini), remove the Extension=php_mysql.dll front;

2. Copy the Php_mssql.dll to the System32 system directory
3. Copy the Ntwdblib.dll to the System32 system directory (this installation Phpnow may have been copied in the past)
3. Restart the server

Test

$odb _conn=mssql_connect (' localhost ', ' sa ', ');
mssql_select_db (' Test ', $odb _conn);
$query = "SELECT * from Test1";
$odb _comm=mssql_query ($query);
$odb _row_num=mssql_num_rows ($odb _comm);
for ($i =0; $i < $odb _row_num; $i + +)
{
$row =mssql_fetch_array ($odb _comm);
Echo ($row [1]);
Echo ("
");
}
?>

Test pass!

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