6.5. Summary

This chapter introduced two new database extensions in PHP 5: mysqli and sqlite. It also presents PEAR DB, which is the most popular database abstraction layer for PHP. In this chapter, you learned:

  • Some of the strengths and weaknesses of mysql versus sqlite

  • When it makes sense to use a database abstraction layer

  • How to connect to databases using mysqli, sqlite, or DB

  • Executing queries and fetching results with mysqli, sqlite, or DB

  • Executing prepared queries with mysqli and DB

  • The difference between buffered and unbuffered queries

  • Various ways of fetching data from queries

  • Database error handling

  • Using triggers and user-defined functions with sqlite

  • How to create portable database code with DB

Get PHP 5 Power Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.