ÄúµÄλÖãºÑ°ÃÎÍøÊ×Ò³£¾±à³ÌÀÖÔ°£¾PHP ±à³Ì£¾PHP 5 Power programming
Team LiB
Previous Section Next Section

6.1. Introduction

A ubiquitous part of any PHP book is the topic of databases and database interfacing with PHP. This book is no different, simply because most people who write PHP applications want to use a database.

Many good books exist on database design and using databases with PHP. This chapter introduces using MySQL and SQLite from PHP, but focuses primarily on the PHP 5, specific details of database interfacing.

After you finish reading this chapter, you will have learned

  • Some of the strong and weak points of MySQL and SQLite, and which types of applications at which they excel

  • Interfacing with MySQL with the new mysqli extension

  • How to use PHP 5's bundled sqlite extension

  • How to use PEAR DB to write more portable database code

A Note About Version Numbers

This chapter focuses on the new database connectivity features of PHP 5, specifically the mysqli and sqlite extensions. To enjoy all the new functionality described in this chapter, you need reasonably current versions of the various packages:

  • MySQL 4.1.2 or newer

  • SQLite as bundled with PHP 5.0.0 or newer

  • PEAR DB 1.6 or newer


    Team LiB
    Previous Section Next Section