电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

Working with Database(数据库开发工作)

Working with Database(数据库开发工作)_第1页
1/30
Working with Database(数据库开发工作)_第2页
2/30
Working with Database(数据库开发工作)_第3页
3/30
下载后可任意编辑Working with Database(数据库开发工作)Yii 提供了强大的数据库编程支持。Yii 数据访问对象(DAO)建立在 PHP 的数据对象(PDO)extension 上,使得在一个单一的统一的 接口可以访问不同的数据库管理系统(DBMS)。使用 Yii 的 DAO 开发的应用程序可以很容易地切换使用不同的数据库管理系统,而不需要修改数据访问代 码。Yii 的 Active Record( AR ),实现了被广泛采纳的对象关系映射(ORM)办法,进一步简化数据库编程。根据约定,一个类代表一个表,一个实例代表一行数据。Yii AR 消除了大部分用于处理 CRUD(创建,读取,更新和删除)数据操作的 sql 语句的重复任务。尽管 Yii 的 DAO 和 AR 能够处理几乎所有数据库相关的任务,您仍然可以在 Yii application 中使用自己的数据库库。事实上,Yii 框架精心设计使得可以与其他第三方库同时使用。Data Access Objects (DAO)Data Access Objects (DAO) provides a generic API to access data stored in different database management systems (DBMS). As a result, the underlying DBMS can be changed to a different one without requiring change of the code which uses DAO to access the data.Yii DAO is built on top of PHP Data Objects (PDO) which is an extension providing unified data access to many popular DBMS, such as MySQL, PostgreSQL. Therefore, to use Yii DAO, the PDO extension and the specific PDO database driver (e.g. PDO_MYSQL) have to be installed.Yii DAO mainly consists of the following four classes:CDbConnection : represents a connection to a database.CDbCommand : represents an SQL statement to execute against a database.CDbDataReader : represents a forward-only stream of rows from a query result set.CDbTransaction : represents a DB transaction.In the following, we introduce the usage of Yii DAO in different scenarios.下载后可任意编辑Establishing Database ConnectionTo establish a database connection, create a CDbConnection instance and activate it. A data source name (DS...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

Working with Database(数据库开发工作)

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部