News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

DevShed:
Utilizing the LIMIT Clause with the Active Record Pattern
March 31, 2009 @ 12:58:35

DevShed continues their series on the Active Record pattern in PHP with this new article implementing the LIMIT statement on your abstraction class.

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.

They add the LIMIT clause as a part of its own function and its own SQL statement. You define the number of rows to fetch, the table to fetch it from and the offset to start from. The SQL is passed off to their fetchRow statement and the results are returned in an array.

0 comments voice your opinion now!
activerecord design pattern clause limit abstraction layer database


blog comments powered by Disqus

Similar Posts

Jani Hartikainen's Blog: Exceptions and abstraction

Phil Sturgeon: Build API's That You Wont Hate: Part 1 - Useful Database Seeding

Jani Hartikainen's Blog: Unit testing 4: Mock objects and testing code which uses the database

Tim Koschuetzki's Blog: How to put Combined Fields Into CakePHP's Model->generateList()

PHPMaster.com: Building Your Own URL Shortener


Community Events





Don't see your event here?
Let us know!


threedevsandamaybe framework unittest podcast install laravel interview language list api testing introduction symfony2 code refactor developer community opinion series release

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework