Product Documentation

FairCom SQL for PHP

Previous Topic

Next Topic

Using PHP 7 + with the PDO Extension

PHP is typically used to create database-driven web pages and websites. Originally, it used conventional SQL to access an underlying database to retrieve data, which determined many aspects of the pages it served up to the user. Developers have long recognized one drawback to this useful functionality: many databases use variations on "standard" SQL, which can make your application difficult to port to a different database.

To address this issue, the community that develops PHP has introduced the PHP Data Objects (PDO) extension for accessing a database. PDO gives you an abstraction layer so that your applications can use the same functions to issue queries regardless of the underlying database. The goal of PDO is to allow an application to be independent of the database it uses. This should allow a developer to change databases with no change in application coding or logic.

FairCom DB PHP offers native support for this extension using a database-specific PDO driver/extension to access the FairCom Server.

  • Developers who are interested in taking advantage of this interface for accessing the FairCom DB database using the latest PHP standard will want to use this interface.
  • Developers who have an existing PHP application that uses PDO are able to upgrade their application to use FairCom DB by simply compiling and installing the driver—no re-coding should be required.
  • Note that the FairCom PDO driver supports PHP version 7+ and not PHP version 5.

The PHP community does not intend PDO to be a complete database abstraction layer. Instead, it is focused on implementing the functions used to issue queries and fetch data. See the PHP website for a detailed definition of what the PDO extension provides and what it does not provide: https://secure.php.net/manual/en/book.pdo.php

In this chapter you will find instructions for Windows and Unix/Linux platforms:

In This Chapter

Connection String

Install PHP 7 PDO and Microsoft IIS on Windows

Install PHP 7 PDO on Linux and Unix

TOCIndex