Home arrow PHP arrow Inserting, Updating and Deleting Database Rows with Code Igniter

Inserting, Updating and Deleting Database Rows with Code Igniter

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.

TABLE OF CONTENTS:
  1. Inserting, Updating and Deleting Database Rows with Code Igniter
  2. Performing conditional SELECT statements with Code Igniter
  3. Inserting new rows into a selected MySQL table
  4. Updating and deleting database records using the active record pattern
By: Alejandro Gervasio
Rating: starstarstarstarstar / 23
September 24, 2008

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

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
 

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: