[ Team LiB ] |
![]() ![]() |
Beneath the AbstractionTo use the DBA functions, you need to have one of the supported database systems installed. If you are running Linux, you probably have the GNU Database Manager (GDBM) installed. For each system, there is a corresponding compile option that should have been used when PHP was installed. You can see the supported databases and their corresponding compile options in Table 12.1.
If your system and PHP installation support one of these systems, you can use the DBA functions with no problems. Note that support for the cdbm system (which is designed for fast access to static databases) is read-only. If you have not compiled PHP with support for any of the DBA handlers listed in Table 12.1, your script will fail with an error when you attempt to use any of the DBA functions. You can check the handlers available to you with the dba_handlers() function. This returns an array of handler names. Adding the following to a script gives you a quick listing of available handlers: var_dump( dba_handlers() ); You could also use the phpinfo() function. The phpinfo() output page has a section on DBA that lists handlers and confirms that DBA support is enabled.
We will use the commonly available GDBM system in our examples. ![]() |
[ Team LiB ] |
![]() ![]() |