Welcome Guest, Not a member yet? Register   Sign In
Codeigniter model problem
#1

[eluser]mahmood rehman[/eluser]
i have the problem.
Fatal error: Class 'Model' not found in C:\wamp\www\CodeIgniter_2.0.0\application\models\book_model.php on line 3
my model class is

<?php

class Book_model extends Model{
function Book_model()
{
parent::Model();

}

function books_getall(){

$query = $this->db->get('country');

return $query->result();
}

}
?>
anyone have idea why this happend ?????????
#2

[eluser]InsiteFX[/eluser]
Did you save it like book_model

InsiteFX
#3

[eluser]mahmood rehman[/eluser]
yah i save it with the name book_model.php
#4

[eluser]n0xie[/eluser]
Change 'Model' to CI_Model
#5

[eluser]danmontgomery[/eluser]
Needs to extend CI_Model, not Model.

Code:
class Book_model extends CI_Model {

    function __construct()
    {
        parent::__construct();
    }
#6

[eluser]mahmood rehman[/eluser]
it runs thanks alot




Theme © iAndrew 2016 - Forum software by © MyBB