Home arrow PHP arrow Handling Result Sets and More with PDO Objects in PHP 5

Handling Result Sets and More with PDO Objects in PHP 5

Building PHP applications that interact with different database systems can be a daunting task, especially from a developer's point of view. To tackle this issue with minor hassles, PHP 5.1 comes bundled with a powerful extension called PDO (short for PHP Data Objects), a library that definitely takes database abstraction to the ultimate level.

TABLE OF CONTENTS:
  1. Handling Result Sets and More with PDO Objects in PHP 5
  2. Preparing queries and fetching database rows
  3. Fetching database rows and columns
  4. Counting affected rows and columns
By: Alejandro Gervasio
Rating: starstarstarstarstar / 5
June 04, 2007

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Introduction

Welcome to the second installment of the series that began with "Using PDO objects in PHP 5." In three approachable tutorials, this series walks you through the implementation of the most important features offered by the PDO extension, and complements its theoretical aspects with concrete examples. In this way you will be able to start quickly using it in your own PHP applications.

Stepping back for a moment to the first article of the series, it's quite probable that you'll recall how this educational journey began. In simple terms, I started explaining some basic tasks that can be performed with the PDO extension, such as opening and closing a connection to diverse database systems (MySQL, Oracle, MS SQL, etc.), in addition to running queries against a selected database and handling PDO exceptions.

Also, it's important to notice here that this PHP library lets you perform all the tasks mentioned above by using an object-oriented notation. This means that if you use this paradigm on a frequent basis when developing your PHP programs, you should take it for granted that you'll feel really comfortable implementing most of its features.

All in all, at this point you hopefully learned how to use some basic methods included with this PHP extension, but logically you may want to learn a few additional ones, so you can have a more polished picture of the overall functionality of the library in question.

Thus, keeping this in mind, over the course of this second tutorial of the series, I'm going to show you how to use the PDO extension to handle different database result sets in all sort of clever ways, in addition to performing some common tasks, like counting rows and columns as well.

Are you ready to take the next step in this instructive journey? Okay, let's begin now!



 
 
>>> More PHP Articles          >>> More By Alejandro Gervasio
 

blog comments powered by Disqus
   

PHP ARTICLES

- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 10 - Follow our Sitemap

Dev Shed Tutorial Topics: