PHP
  Home arrow PHP arrow Inserting, Updating and Deleting Database Rows with 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? 
Google.com  
PHP

Inserting, Updating and Deleting Database Rows with Code Igniter
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 7
    2008-09-24


    Table of Contents:
  • Inserting, Updating and Deleting Database Rows with Code Igniter
  • Performing conditional SELECT statements with Code Igniter
  • Inserting new rows into a selected MySQL table
  • Updating and deleting database records using the active record pattern

  • 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


    Inserting, Updating and Deleting Database Rows with Code Igniter
    ( Page 1 of 4 )

    You've seen some of the things you can accomplish with the Code Igniter PHP framework in earlier parts of this series. In this seventh part of the series, you will learn, through copious examples, how to perform insertions, updates and deletions on a selected MySQL table by using Code Igniter’s database class. You'll see that these tasks are very intuitive and easy to grasp, thanks to Code Igniter's friendly learning curve.

    Introduction

    Admittedly, using a third-party PHP framework for building web applications rapidly confronts a PHP programmer with several challenging tasks, such as installing its source files and folders in the testing web server, probably editing and configuring a bunch of initialization parameters, and dealing with its learning curve.

    Although in certain cases, all of these tasks can be accomplished in a relatively painless way, the truth is that there are several PHP frameworks available nowadays on the web that are pretty difficult to set up, and certainly come packaged with many features that can be quite overwhelming, particularly for inexperienced developers.

    Fortunately, this isn’t the case with Code Igniter (http://codeigniter.com), a compact and powerful PHP framework developed in PHP 4 that permits you to create full-featured web applications very quickly. Among other things, it features a friendly learning curve.

    And now that I mentioned the term “friendly,” you may recall that during the preceding article of this series, I demonstrated how easy it is to perform conditional SELECT statements against a selected table with the Code Igniter’s database class. Indeed, this class not only allows you to run queries using a traditional approach; it also allows you to select, insert, update and delete database records by means of the active record pattern, which lets you avoid coding SQL clauses explicitly.

    In the aforementioned article I developed a couple of hands-on examples aimed at demonstrating how to select a few database rows via the active record approach. However, as I said before, Code Igniter lets you perform inserts, updates, and deletion operations using this design pattern as well.

    Therefore, in the next few lines I’ll be discussing these interesting topics, as always, by means of several code samples. So, are you ready to learn how to insert, update and delete database records with Code Igniter? Then don’t waste more time in preliminaries. Start reading now!



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

       

    PHP ARTICLES

    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL
    - Method Chaining: Adding More Methods to the ...
    - Method Chaining in PHP 5





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek