Welcome Guest, Not a member yet? Register   Sign In
CI tutorials failed and code did not work - bad code or my setup?
#5

[eluser]ICEcoffee[/eluser]
@inparo: thanks for your helpful reply.

an example of the problem I'm having:
I pretty much copied and pasted the code below from the CI user manual, models page, but when I point browser to class, I get the '404 error' message.

Model: filename = blog_model.php (all lower case)
Code:
<?php
class Blog_model extends Model
{
    var $title   = '';
    var $content = '';
    var $date    = '';
    
    function Blog_model()
    {
        parent::Model();

    }
    
    function get_last_ten_entries()
    {
        $query = $this->db->get('blog', 2);
        return $query->result();
    }
    
}
?>



Controller: filename = blog_controller.php
Quote:<?php
class Blog_controller extends Controller {

function blog()
{
$this->load->model('Blog');

$data['query'] = $this->Blog->get_last_ten_entries();

//dont want to go to view yet - $this->load->view('blog', $data);
}
}
?>

database table name is 'blog', with 2 entries.

I have edited the database.php file, and re-checked details.
my browser is pointing to: http://localhost/ci/index.php/blog

is it something I've done wrong?


Messages In This Thread
CI tutorials failed and code did not work - bad code or my setup? - by El Forum - 04-10-2008, 10:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB