PHP Development Framework Yii Framework Tutorial (23) Database-Overview

Source: Internet
Author: User
Tags mysql database yii

YII provides powerful database programming support.

The Yii data Access Object (DAO) is built on the PHP data object (PDO) extension, making it possible to access different database management systems (DBMS) in a single unified interface. Applications developed using Yii DAO can easily switch between using different database management systems without having to modify the data access code.

The active record (AR) of YII implements a widely used object-relational mapping (ORM) approach to further simplify database programming. By convention, 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 handle CRUD (create, read, update, and delete) data operations.

Although Yii DAO and AR can handle almost all database-related tasks, you can still use your own database library in Yii application. In fact, the YII framework is well-designed so that it can be used concurrently with other Third-party libraries.

The data interfaces supported by the YII framework are mainly three of the following:

Active Record

Query Builder

DAO

The sample database used in this tutorial is

Chinook database, the sample library, which is the famous Northwind databases, is currently supported by the following data types:

DB2

Effiproz

Mysql

Oracle

PostgreSQL

SQL Server

SQL Server Compact

Sqlite

Its data model is:

This tutorial is mainly used in MySQL, mainly because of the database type used with PHP with the most MySQL, so you need to install the MySQL database, the YII framework to support a variety of database types, support these database access interface is basically similar, so although this tutorial using MySQL as an example, The knowledge used also applies to other database types.

See a full set of tutorials: http://www.bianceng.cn/webkf/PHP/201301/35265.htm

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.