Web Development

PDO Introduction | PHP DATA OBJECT | Lightweight and Consistent interface for accessing multiple databases in PHP

PDO (PHP Data Object) is the lightweight and consistent interface for accessing the multiple databases (even of different types) through PHP.

PDO provides the data access abstraction layer, which means without worrying about the database type you can use the same functions for querying the databases.

PDO comes with PHP 5.1 and available as PECL extension for PHP 5.0, PDO requires the OO features in the core of the PHP, so it’s not compatible with the older version of the PHP.

No external libraries are needed to run this extension.

Installation:

For UNIX:

PDO and PDO_SQLITE drivers are enabled by default in PHP 5.1.0.

When installing PDO as the module, php.ini needs to be update so it loads the PDO extension when PHP runs.

Below line should comment out in order to load the PDO extension as a module.

[cc lang=”php”]
extension=pdo.so
[/cc]

For Windows:

PDO and all major drivers come with PHP as a shared module and simply need to be activated by editing the php.ini

[cc lang=”php”]
extension=php_pdo.dll
[/cc]

Now next in order to enable other driver specific DLL files you can user either dll() to load dll files or you can simply enable it from php.ini file.

[cc lang=”php”]
extension=php_pdo.dll
extension=php_pdo_firebird.dll
extension=php_pdo_informix.dll
extension=php_pdo_mssql.dll
extension=php_pdo_mysql.dll
extension=php_pdo_oci.dll
extension=php_pdo_oci8.dll
extension=php_pdo_odbc.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
[/cc]

But be sure that these dll’s must me exists in the PHP extension directory.

Keep in touch for next updates related to PDO.

Source : PHP PDO

Shares:
  • wedigg.co.uk
    August 8, 2010 at 2:00 am

    PDO Introduction | PHP DATA OBJECT | Lightweight and Consistent interface for accessing multiple databases in PHP. | Xpert Developer…

    PDO (PHP Data Object) is the lightweight and consistent interface for accessing multiple databases (even of different types) in PHP.PDO provides a data-access abstraction layer, which means without worrying about the database type you are using you can…

    Reply
  • […] In previous post I have introduced some basic introduction about the PDO ( PHP DATA OBJECT ). […]

    Reply
  • Demton
    Demton
    August 24, 2010 at 5:16 am

    This is such a great resource that you are providing and you give it away for free. I enjoy seeing websites that understand the value of providing a prime resource for free. I truly loved reading your post. Thanks!

    Reply
  • forex robot
    forex robot
    August 24, 2010 at 10:01 pm

    nice post. thanks.

    Reply
  • […] PDO Introduction […]

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *