Home arrow PHP arrow Utilizing the LIMIT Clause with the Active Record Pattern

Utilizing the LIMIT Clause with the Active Record Pattern

Welcome to the fifth installment of a series focused on using the active record pattern with PHP. Made up of seven episodes, this series walks you through the progressive development of a MySQL abstraction class that utilizes the active record approach to perform CRUD (Create, Remove, Update, Delete) database operations and SELECT queries, without having to explicitly code any SQL statements.

TABLE OF CONTENTS:
  1. Utilizing the LIMIT Clause with the Active Record Pattern
  2. Review: fetching database records using the LIKE clause
  3. Enhancing the functionality of the MySQL class with the LIMIT clause
  4. Example: fetching database rows with the LIMIT clause
By: Alejandro Gervasio
Rating: starstarstarstarstar / 6
March 31, 2009

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Introduction

Now that you've been introduced to the main subject of this group of articles, it's time to recall the topics that were covered in the last one. In that specific tutorial I explained how to build a basic MySQL abstraction class, which was capable of performing the CRUD tasks mentioned before, in addition to fetching database records using the LIKE clause.

Of course, the structure of this class is rather primitive and definitely wasn't suited for use in production environments. Despite this disadvantage, it came in useful for demonstrating how it can be utilized for accessing MySQL databases by means of the active record approach.

However, it's fair to mention that the functionality of the class can be enhanced. In its current version, it'll be able to accomplish only a few basic database operations tasks. Therefore, this fifth article of the series will be focused on enabling the class to fetch database rows by using the LIMIT clause.

By following the same approach demonstrated in preceding articles, this brand new capacity will be implemented through the active record pattern, in this manner extending its utilization within a MySQL abstraction class even more.

Now, it's time to get our hands dirty with a few functional PHP code samples. Let's jump in!



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

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- 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...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: