Chapter 8. Working with DatabasesPHP comes packed with support for databases, which is good because developers often want to manage and store their data on a server. All kinds of database servers are supported in PHP; you can see the list in Table 8-1.
As you can see, there are many different database servers out there. We can't cover them all here, so we'll focus on the database that's the most popular to work with PHP: MySQL, which you can get for free from http://www.mysql.com. The current production release of MySQL is 4.0, which is what we're going to use in this chapter. We'll also take a look at the PHP DB module later in this chapter, which provides a layer of abstraction over database operations, letting you work with many different database servers, such as the ones you see in Table 8-1, in addition to MySQL, using the same function calls. If you want to use the built-in PHP support for the various database servers in Table 8-1, you can find the manuals for them at http://www.php.net/dbname, where dbname is the database name, such as mysql, sybase, mssql, and so on. For ODBC, use the name uodbc; for Oracle, use oci8. The DB module lets you access all these database servers in the same way, but using the native built-in support is much faster. |