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

[eluser]dang2man[/eluser]
i have this code and when i tried to open it say

PHP Fatal error: Class 'Model' not found in C:\wamp\www\ci\application\models\mcat.php on line 2
<?php
class Mcat extends Model{

function __construct() {
parent::__construct();
}
function getCategory($id){
$data = array();
$options = array('id'=>$id);
$q = $this->db->getwhere('categories',$options,1);
if($q->num_row > 0){
$data = $q->row_array();
}
$Q-> free_result();
return $data;
}


function getAllCategories(){
$data = array();
$q = $this->db->get('categories');
if($q->num_row() > 0){
foreach ($q->result_array() as $rows){
$data = $rows;

}
$q = free_result();
return $data;
}

}

}


?>


i have added mcat in autoload.php


Messages In This Thread
problem with model - by El Forum - 06-09-2011, 12:43 PM
problem with model - by El Forum - 06-09-2011, 01:49 PM
problem with model - by El Forum - 06-11-2011, 01:14 AM
problem with model - by El Forum - 06-11-2011, 02:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB