Database Abstraction Layer PDO

Source: Internet
Author: User
Tags object object

PDO (PHP Data Object), a database access abstraction layer, unifies the various database access interfaces.

PDO features: Encoding consistency, flexibility, high performance, object-oriented features.

PDO is simply an abstract interface layer, which cannot operate the database itself.

One, PDO installation and configuration

1. Configure the PHP configuration file to open the appropriate extension extension = Php_pdo.dll

2. Open the response database extension extension = Php_pdo_mysql.dll

3. You can see the details of the PDO extension by viewing the Phpinfo

Second, PDO connection database

1. Connect the database as a parameter "recommendations"

????

???? $DSN the data source to which you want to connect the database. If the connection succeeds, the database object object is returned.

2. Connecting to a database by URI

????

3. Connect to the database as a configuration file "not recommended"

Database Abstraction Layer PDO

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.