PHP
  Home arrow PHP arrow Working with the Active Record Class i...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Working with the Active Record Class in Code Igniter
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-09-17

    Table of Contents:
  • Working with the Active Record Class in Code Igniter
  • Pulling database records with Code Igniter’s active record class
  • Performing conditional SELECT queries with the active record pattern
  • Selecting database rows that match a given condition

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Working with the Active Record Class in Code Igniter


    (Page 1 of 4 )

    If you’re a PHP developer who’s searching for a third-party framework that lets you build full-blown web applications without having to deal with a long and hard learning curve, then this group of articles might be what you really need. Welcome to the sixth installment of the series entitled “Introducing the Code Igniter PHP Framework.” By using a hands-on approach, this series of articles walks you through the main features that come packaged with this friendly yet powerful development software that lets you quickly build robust PHP applications.

    Naturally, if you’ve already read all the tutorials that precede this one, then you're probably familiar with utilizing some core classes that come bundled with Code Igniter. This framework can be used to perform all sorts of clever tasks, including the validation of HTML forms, working with MySQL, paging database records, and so forth.

    Indeed, this PHP 4-based framework allows you to develop a wide range of programs, by using the model imposed by the Model-View-Controller pattern. This pattern makes it extremely convenient to separate application logic from visual presentation.

    And now that I mentioned the MVC approach, surely you’ll recall that in the previous article of this series, I explained how to apply this design pattern to developing a web application whose main goal was validating the data entered into a sample online form.

    As with any other web program developed with Code Igniter, this data validation application was composed of two primary modules. The first one was a controller class, which implemented all the logic required for checking the validity of the data entered on the mentioned HTML form.

    The second module was comprised of two view files, which were used either to redisplay the form in question along with a bunch of error messages, or to print on screen a simple confirmation message, depending on the result of the validation process. Does all of this ring any bells for you? I bet it does!

    Besides, as I mentioned earlier, Code Igniter comes equipped with a handy active record class that permits you to select, insert, update and delete database rows without having to explicitly code any SQL statements. Therefore, in the next few lines I’ll be creating some hands-on examples for you, aimed at demonstrating how to use this class to manipulate a few basic records stored on a MySQL table.

    Are you ready to learn how to use the active record pattern within the Code Igniter’s context? Then let’s begin now!

    More PHP Articles
    More By Alejandro Gervasio


       · This chapter of the series will give you a quick overview on working with...
       · The article is usefull, but what is the difference between Page #3 and Page #4? The...
       · Thanks for the kind comments on my PHP article. In fact, the pages that you mention...
     

       

    PHP ARTICLES

    - Using Aliases and the Autoload Function with...
    - Authentication Scripts for a User Management...
    - Utilizing the Use Keyword for Namespaces in ...
    - Building a User Management Application
    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Sub Classing Exceptions in PHP 5
    - Building a Content Management System with Co...
    - Filters and Login Systems for Web Applicatio...

     
    Application Delivery: Everything You Wanted to Know, but Didn`t Know You Needed to Ask
    A comprehensive guide to examining the topics of Wide-area Data Services and app....

     
    Best Practices: Safe and Secure Hardware Asset Recovery
    Companies increasingly must meet EPA and local requirements for the disposal of ....

     
    Managing SSL Security in Multi-Server Environments
    Read this white paper to learn how to simplify management of your organization's....

     
    Open Source Security Myths
    Open Source Software (OSS) is computer software whose source code is available t....

     
    Power and Cooling Capacity Management for Data Centers
    This paper describes the principles for achieving power and cooling capacity man....

     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT