PHP
  Home arrow PHP arrow Working with the Active Record Class in Code Igniter
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
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: starstarstarstarstar / 3
    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:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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
     

       

    PHP ARTICLES

    - Using Directory Iterators to Build Loader Ap...
    - Using the spl_autoload() Functions to Build ...
    - Working Out of the Object Context to Build L...
    - Using the _autoload() Magic Function to Buil...
    - The Destruct Magic Function in PHP 5
    - The Autoload Magic Function in PHP 5
    - Developing a Recursive Loading Class for Loa...
    - The Sleep and Wakeup Magic Functions in PHP 5
    - Using the Clone Magic Function in PHP 5
    - Including Files Recursively with Loader Appl...
    - The Call Magic Function in PHP 5
    - Designing a Captcha System with PHP and MySQL
    - Using Static Methods to Build Loader Apps in...
    - The Isset and Unset Magic Functions in PHP 5
    - Advanced PHP Form Input Validation to Check ...





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