[eluser]jmorty[/eluser]
guys nid help here..
i try to make simple books libraries and i encountered problems.
see this code please
function getall(){
$this->load->database();
$this->load->library('table');
$query = $this->db->query('SELECT * FROM books');
$table = $this->table->generate($query);
return $table;
}
this is the method i use to get the data from my database
i use table library. I put this code in models
and then,
function main(){
$this->load->library('table');
$this->load->model('books_model');
$data = $this->books_model->general();
$data['table'] = $this->books_model->getall();
$this->load->view('books_main',$data);
}
this is the function i made in my controllers to get the data from my models.
The problem is that i cant view all my data from my database in the browser. i dont know what is the exact problem.
by the way im new in CI. so please guide me.
help please!!!
Thanks