CodeIgniter Forums
error in pagination - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: error in pagination (/thread-49520.html)



error in pagination - El Forum - 02-23-2012

[eluser]Unknown[/eluser]
Some body please help me...

I was doing adding,deleting and editing for a page content in codeigniter..The problem arises when i add pagination to the page..there is no problem for add or edit. But for delete, there is some problem...it shows Fatal error: Call to a member function result_array() on a non-object ...


error in pagination - El Forum - 02-23-2012

[eluser]aquary[/eluser]
Please post the code of your data selection, especially those around the line number included with the error.

Actually... this should be in the Coding forums >:3


error in pagination - El Forum - 02-23-2012

[eluser]Kamarg[/eluser]
Check that your query is succeeding. It appears that it is failing and returning boolean FALSE which obviously doesn't have a result_array function.


error in pagination - El Forum - 02-23-2012

[eluser]aquary[/eluser]
In that case, result_array() should already return empty array.

From the userguide
result_array()
This function returns the query result as a pure array, or an empty array when no result is produced.

PS. Somehow, I remembered seeing the $this->db->result(); returned FALSE when it's empty... have to check about this.