Building a Database-Driven Application with the Code Igniter PHP Framework (
Page 1 of 4 )
If you’re a PHP developer who’s searching for a framework that lets you build full-blown web applications very quickly and with an easy learning curve, look no further. Welcome to the second part of the series entitled “Introducing the Code Igniter PHP framework.” This series of articles shows you how to use this friendly yet powerful PHP framework to easily develop database-driven applications by using the Model-View-Controller design pattern.Introduction
Now that you have been introduced to the main subject of this series, it’s time to recall the concepts deployed in the preceding tutorial, in case you haven’t had the chance to read it yet. During that article, I discussed a few basic topics you will need to understand to start using Code Igniter, ranging from how to correctly set up its configuration files and understanding its URL routing mechanism, to developing a sample web application, which made use of the Model-View-Controller approach.
Put in a simple way, the application was tasked with displaying a trivial message on screen, a process that was performed by way of two source files. The first one was defined as the application’s controller, and the second one was simply a template file, also known as a “view” within the context of the MVC pattern.
Essentially, the relationship established between these two sample files can be outlined as follows: the controller precisely controls the flow of the application and passes a bunch of data to be embedded into an HTML file to the view, which is finally displayed on screen. That’s all.
However, this initial sample application was pretty primitive, actually. Therefore, in this second part of the series, I’m going to teach you how to use some core classes bundled with Code Igniter, this time for building a MySQL-driven program, which will first fetch some data from a MySQL database table, and then print this information on the browser.
As you’ll see in the next few lines, developing this PHP application will require us to define a model class, apart from building the respective controller and view files. Thus, don’t waste more time in preliminaries and begin reading now!
| | Discuss Building a Database-Driven Application with the Code Igniter PHP Framework | | | | | | | In this second part of the series, you’ll get started using some core classes... | | | | | | Hello, Alejandro i just ask you What do you think of this outdated php4 style, which... | | | | | | I get a class redefined error with the code presented in the article. The problem is... | | | | | | There doesn't appear to be any indentation in the sample code, making it very hard... | | | | | | Thanks for the kind comments on my PHP article. As I explained in the first article,... | | | | | | Thanks for the kind comments on my PHP article. Sorry to hear about code indentation... | | | | | | Thanks for the kind words on my PHP article. Yes, your code is a correct... | | | | | | Alejandro,
Really great job on this tutorial. It's simple and straight... | | | | | | The issue you mentioned has been clarified in a previous part of this series. Thanks... | | | | | | Hi Allejandro,
I get an error using your code and have not been able to solve it.... | | | | | | Quite possibly, the error you're getting happens because you’ve pasted my code... | | | | | | I got the header already sent error when I didn't add the <?php and ?> at the... | | | | | | Al,
Not sure if this is an error but the index() function in the users controller... | | | | | | Thanks for catching that typo in the method name. It’ll be useful for other users... | | | | | | While I do appreciate the time that went into making this tutorial - if the code... | | | | | | Why are you removing the starting and closing PHP tags? Removing the closing one at... | | | | | | Sorry to hear that indeed, but all the code samples were properly tested. If you... | | | | | | >>> Post your comment now! | | | | | |
|
 |