Php connection to mysql, mssql, acces, pdo and other connection database code

Source: Internet
Author: User
Tags mdb database php mysql
This article provides four database connection programs for php, such as phpmysql, which are commonly used with mssql. as for phpaccess data connections, the other is to use phppdo to connect to the database code... this article provides four database connection programs for php, such as php mysql, which are commonly used with mssql. as for php access data connections, in addition, php pdo is used to connect to the database code. I used it when collecting data with the locomotive.

 Open ($ connstr); // php uses pdo to connect to the mdb Database. this is suitable for the user $ path = "F: \ ontSpiderResult. mdb "; $ conn = new PDO (" sqlite: $ path "); if ($ conn) {echo ('connection pdo success ');} else {echo ('cnnection pdo fail, plase check database server! ');} // Php and mssql database connection code $ link = mssql_connect ("127.0.0.1", "sa", "sa ") or die ("Can't connect SQL server"); mssql_select_db ("frrc", $ link) or die ("Select database failure ");

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.