[eluser]Ornis[/eluser]
I got stuck with an error: Fatal error: Call to a member function on a non-object in / ... application/models/zug_model.php on line 15
I load the model in the controller and call the function getSimple() :
<?php
class Vogelkarte extends Controller {
function Vogelkarte()
{
parent::Controller();
$this->css = $this->config->item('css');
$this->js = $this->config->item('js');
$this->load->model(array('Zug_model'));
}
function get_it() {
$data['artenauswahl'] = $this->Zug_model->getSimple('artenliste',
array('id','art_de'));
var_dump($data['artenauswahl']);
}
?>
The Model looks like this
<?php
class Zug_model extends Model {
/**
* Konstruktor
*/
function Zug_model() {
parent::Model();
}
function getSimple($table = '',
$fields = array()
) {
$this->db->from($table);
$this->db->select($fields);
return $this->db->get();
}
}
?>
Why do I loose the $this-db object?
I'm currently working with php 4.4.9. Thanks.