Welcome Guest, Not a member yet? Register   Sign In
Error while creating table with HTML Table Class
#11

[eluser]elvix[/eluser]
I'd maybe rewind one more step -- comment out all your code and paste in the example from the user guide / html table class, and see if that worked or not. Try loading the library in your controller, too.

I'd also try checking the model function that generates $users to check whether it returns an array or object, since I'm not sure is_array() would make the distinction. You should have something like $query->result_array() in there.

Anyway, good luck! Smile
#12

[eluser]Sytze Loor[/eluser]
Thanks for the reply.
I tried copy-pasting the user guide example, but it still gives an error on anything with $this->table in it.
The model function that creates $users returns
Code:
return $query->result_array();
so I'm pretty sure it's array and there are 2 records in it.

I think we can say for sure by now that the problem is in the Table class and not in the model. I also tried the Table class in several other controllers and they all give the same error ('Call to a member function generate() on a non-object'). I'm running on version 1.6.3, does anyone else have the same problem?

The strange thing is that I did all by the book;
load the table library
generate headers for the table
add a few rows

Sytze
#13

[eluser]Sytze Loor[/eluser]
Ok, thanks for everything. It was a really stupid thing I created myself. As a matter of fact I created a variable ($this->table) that was a reference to a mysql table. Stupid stupid stupid, but thanks for all the input!

Sytze
#14

[eluser]Yash[/eluser]
its not stupid..sometimes it happens.
anyways goodluck




Theme © iAndrew 2016 - Forum software by © MyBB