Welcome Guest, Not a member yet? Register   Sign In
database question -> get rows from complex query AND results in ONE query ?!
#1

[eluser]Richard Schumann[/eluser]
hi mates,

a question for the pros :

lets say you have a complex query with joins and like stuff in, and you wanna know the num_rows of it, BUT you need as well the get() after that . how to do that without write everything twice for the query ?!

i need the row_count to render the "older page" button - and i dont need the limited count...

so something like :
Code:
$this->db->from('user')->blablabla->bla->limit($entryspersite,$offset)->get()->result_array();
$rows_of_everything_what_match = $this->db->get()->num_rows();

after the get() i cant do that without write the full query again, and i dont wanna repeat myselft in code.
any common solution or something like last_query_without_get() function ?!

ty so m uch for help


Messages In This Thread
database question -> get rows from complex query AND results in ONE query ?! - by El Forum - 05-17-2010, 11:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB