PHP development framework YiiFramework tutorial (23) database-overview

Source: Internet
Author: User
PHP development framework YiiFramework tutorial (23) database-overview

Yii provides powerful database programming support.

The Yii Data Access Object (DAO) is built on the data object (PDO) extension of PHP, so that a single unified interface can access different database management systems (DBMS ). Applications developed using DAO of Yii can easily switch to different database management systems without modifying the data access code.

Yii's Active Record (AR) implements the widely used object relationship ORM ing (ORM) method to further simplify database programming. According to the conventions, a class represents a table, and an instance represents a row of data. Yii AR eliminates the repetitive tasks of most SQL statements used to process CRUD (create, read, update, and delete) data operations.

Although Yii DAO and AR can process almost all database-related tasks, you can still use your own database in Yii application. In fact, the Yii Framework is well designed to be used together with other third-party libraries.

The Yii Framework supports the following data interfaces:

Active Record

Query Builder

DAO

The example database used in this tutorial is

Chinook Database. The example Database is a famous NorthWind Database. Currently, the supported data types include:

DB2

EffiProz

MySQL

Oracle

PostgreSQL

SQL Server

SQL Server Compact

SQLite

The data model is:

This tutorial mainly uses MySQL, mainly because MySQL is the most frequently used database type in combination with PHP. Therefore, you need to install MySQL database. the Yii frame supports multiple database types, the interfaces supporting these databases are similar. Therefore, even though MySQL is used in this tutorial, the knowledge used is also applicable to other database types.

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.