Welcome Guest, Not a member yet? Register   Sign In
cant view data from database
#1

[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
#2

[eluser]maria clara[/eluser]
hi,

i had encountered the same error with yours but now it's ok. try to see this: [email=http://ellislab.com/codeigniter/user-guide/]user guide[/email]

regards,
maria
#3

[eluser]jmorty[/eluser]
i cant open your link. it goes to outlook express mail
#4

[eluser]maria clara[/eluser]
here try this [email=http://ellislab.com/codeigniter/user-guide]user guide[/email]
#5

[eluser]maria clara[/eluser]
[quote author="jmorty" date="1262776759"]i cant open your link. it goes to outlook express mail[/quote]

even i cant open it.. try to see the user guide of this codeigniter.that could help you.

regards,
maria
#6

[eluser]jmorty[/eluser]
yeah i found it. sori for not being observant. anyway thanks a lot Big Grin
#7

[eluser]maria clara[/eluser]
it's okey. nice to hear you found it..gudluck.

regards,
maria




Theme © iAndrew 2016 - Forum software by © MyBB