Databases

The ease with which PHP can be used to create dynamic, database-driven websites is for many the key reason to use it. The stock build of PHP comes with support for MySQL, PostgreSQL, SQLite, Oracle, Microsoft SQL Server, ODBC, plus several other popular databases, so you are sure to find something to work with your data.

If you want to, you can learn all the individual functions for connecting to and manipulating each database PHP supports, but a much smarter idea is to use pear::db. pear::db is an abstraction layer over the databases that PHP supports, which means you write your code once, andwith the smallest of changesit will work on every database server.

PEAR is the script repository for PHP and contains numerous tools and prewritten solutions for common problems. pear::db is perhaps the most popular part of the PEAR project, but it is worth checking out the PEAR site to see whether anything else catches your eye.

Was this article helpful?

0 0

Post a comment