Chapter8.Working with Databases


Chapter 8. Working with Databases

PHP 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.

Table 8-1. Supported Database Applications

Database

Adabas

Ingres

Oracle

dBase

InterBase

Ovrimos

Empress

FrontBase

PostgreSQL

FilePro

mSQL

Solid

Hyperwave Direct

MS-SQL

Sybase

IBM DB2

MySQL

Velocis

Informix

ODBC

SQLite

Unix dbm

  


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.



    Spring Into PHP 5
    Spring Into PHP 5
    ISBN: 0131498622
    EAN: 2147483647
    Year: 2006
    Pages: 254

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net