Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter 2.0 Database Tutorial required
#1

[eluser]eliminator2009[/eluser]
I am new to codeigniter can you pls provide me a tutorial on version 2.0.2.
#2

[eluser]Italo Domingues[/eluser]
http://ellislab.com/codeigniter/user-guide/
#3

[eluser]InsiteFX[/eluser]
CodeIginter User Guide - The Database Class

Read the Active Record part.

InsiteFX
#4

[eluser]Dimitri Backaert[/eluser]
Hi,

As a follow up to this post, I have the following question.

I'm also a new user of CI, and I'm eager to learn it to improve
my web applications.

I've recently found a tutorial on the web, but it uses
CI version 1.7.1

I've discovered that there are quite some differences in the latest
version and the version mentioned above.

Is there any (easy) way to highlight or specify the changes in this
tutorial, compared to the new CI version?
Ideally, is there a tutorial using CI v. 2.x? Or can the tutorial below
be updated?
Tutorial v.1.7.1

Thanks in advance.

Kindly Yours
#5

[eluser]Josh Holloway[/eluser]
The basics of that tutorial will assist you in getting started. There are some changes in 2.0 but the basis of the framework remains the same and the tutorial you've linked will help.

Also check the user guide as linked above by both Italo and InsiteFX and soon enough you'll be on your way
#6

[eluser]Dimitri Backaert[/eluser]
[quote author="Josh Holloway" date="1304561152"]The basics of that tutorial will assist you in getting started. There are some changes in 2.0 but the basis of the framework remains the same and the tutorial you've linked will help.

Also check the user guide as linked above by both Italo and InsiteFX and soon enough you'll be on your way[/quote]

Hi Josh,

Thanks for your reply.
However, I'm currently trying to follow this tutorial, and I'm having
trouble creating my first class.

I get the following Error Message (in my browser):
An Error Was Encountered
Unable to load the requested class: product


I'm not really spotting the error in the Product Class:
Code:
class Product extends CI_Controller {

    /**
     * Index Page for this controller.
     *
     * Maps to the following URL
     *         http://example.com/index.php/product
     *    - or -  
     *         http://example.com/index.php/product/index
     *    - or -
     * Since this controller is set as the default controller in
     * config/routes.php, it's displayed at http://example.com/
     *
     * So any other public methods not prefixed with an underscore will
     * map to /index.php/product/<method_name>
     * @see http://ellislab.com/codeigniter/user-guide/general/urls.html
     */
     public function __construct()
    {
        parent::__construct();
    }
    public function index()
    {
        $this->load->model('product_model');
        $data['products'] = $this->product_model->retrieve_products();
        var_dump($data['products']);
    }
}

In the tutorial they teach me to use the following function in stead of the __construct() function:
Code:
public function Product()
{
    parent::CI_Controller();
}

However, this is not a solution, the error remains.

Any help is appreciated.
#7

[eluser]InsiteFX[/eluser]
It should be like this:
Code:
// NOTE: This is not needed if you are not setting anything!
public function __construct()
{
    parent::__construct();
}

InsiteFX
#8

[eluser]runs.amock[/eluser]
Did you get it solved?
#9

[eluser]eliminator2009[/eluser]
I know the USER GUIDE is the best information provider but i am now come at how to setup directory structure but how do i create Controller, Model, View, Hooks, Helper and so on with codeigniter 2.0.2 is there any step by step database project or Book.

Thanks ;-)
#10

[eluser]Dimitri Backaert[/eluser]
[quote author="InsiteFX" date="1304580596"]It should be like this:
Code:
// NOTE: This is not needed if you are not setting anything!
public function __construct()
{
    parent::__construct();
}

InsiteFX[/quote]

Can you point out the difference? I don't really see it.
Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB