Welcome Guest, Not a member yet? Register   Sign In
Difference between usage of return $query->result() and return $query-row()
#3

[eluser]Stefan Hueg[/eluser]
result() is working for single results, too, and you have nothing to change.

To make the difference clearer: use result() if you expect to get 0-n results, whereas n can be any number, use row() if you exactly know that you can only get 0-1 results (by limiting the query using $this->db->limit(...) for example) or in case that you are accessing unique data where you are absolutely sure that there is just one result.


Messages In This Thread
Difference between usage of return $query->result() and return $query-row() - by El Forum - 04-30-2012, 06:39 PM



Theme © iAndrew 2016 - Forum software by © MyBB