PDO: Introduction PHP Data Object



PHP Data Objects (PDO) Step By Step Tutorial - Part 1: PDO is a PHP5 extension that defines a lightweight DBMs connection abstraction library. Mmm, we ever talk about DMB connection abstraction library (sometimes called data access abstraction library). Yup, we talk data access abstraction library using ADOdb. PHP ADOdb special for PHP4 and PDO only work for PHP5. PDO have function like ADOdb with more benefits.

What is data access abstraction library? As we know, PHP support several major database, such as mySQL, SQLite, msSQL, and so on. Each connection to those database have unique code. For example, we want to connect to mysql, we wil write:

mysql_connect($host, $user, $password);

If we want to connect to SQLite:

sqlite_open($db, 066);

for postgreSQL:

pg_connect("host=$host dbname=$db user=$user password=$password");

What that mean? For example, we have built application base on mysql. When our customer need move to SQLite, we must rebuild our application. We must rewrite many line code. How if our code consist 1,000,000 lines? Nightmare!

Data access abstraction layer will bridge the different. We just write once, and run in every where (like java he he he....)

Next, we talk how to activate PDO extension.

Previous:PHP Data Object/PDO Tutorial
Next: PDO: Activation PHP Data Objects Extension



Series this article:
PDO: Introduction PHP Data Object
PDO: Activation PHP Data Objects Extension
PDO: Connecting Use PHP Data Object
PDO: Portable Connection to Database
PDO: Posibble Fetch Mode
PDO: Error Handling
PDO: Prepared Statement
PDO: Positional and Named Placeholders
PDO: Insert and Update Statement Use Prepared Statement
PDO: Prepared Statement and Bound Values
PDO: Working With BLOBs
PDO: Alternative Retrieve BLOB Data
PDO: Setting Connection Attributes
PDO: Error Mode Attributes
PDO: Improve Performance with Persistent Connection
PDO: Getting Connection Attributes


Tag: PHP Data Objects, PDO, extension, PHP extension Category: PHP Database Post : April 18th 2008 Read: 6,021 Bookmark and Share

blog comments powered by Disqus