O'Reilly logo

PHP Pocket Reference by Rasmus Lerdorf

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Database Functions

PHP supports a number of databases directly through the databases’ own native APIs. Each of the databases is covered in a separate section. Many of the databases can also be accessed through ODBC if appropriate ODBC drivers are available for that particular database. Adabas-D, Solid, Empress, Velocis and IBM DB2 have native APIs that are so similar to the ODBC API that having a separate set of functions for each one was redundant. So, for these five databases, use the ODBC set of functions. It is important to understand, however, that for those five databases, the actual communication is direct and native and does not go through any sort of intermediary ODBC layer.

dBase Functions

PHP allows you to access records stored in dBase-format (dbf) databases. dBase files are simple sequential files of fixed length records. Records are appended to the end of the file and deleted records are kept until you call dbase_pack( ). Unlike with SQL databases, once a dBase file is created, the database definition is fixed. There are no indexes that speed searching or otherwise organize your data. Because of these limitations, I don’t recommend using dBase files as your production database. Choose a real SQL server, such as MySQL or Postgres, instead. PHP provides dBase support to allow you to import and export data to and from your web database, as the format is understood by Windows spreadsheets and organizers. In other words, the import and export of data is about all that the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required