Welcome Guest, Not a member yet? Register   Sign In
return num_rows and query results
#1

[eluser]Samuurai[/eluser]
Hi everyone!

From the documentation, it says to do this to return the number of rows:
Code:
$query = $this->db->query('SELECT * FROM my_table');

echo $query->num_rows();

I want to also run this query

Code:
$result = $this->db->like('error_string', 'match');

How can I make it so my function only hits the database once in my model?

Thanks everyone.


Messages In This Thread
return num_rows and query results - by El Forum - 05-29-2009, 11:10 AM
return num_rows and query results - by El Forum - 05-29-2009, 11:18 AM
return num_rows and query results - by El Forum - 05-29-2009, 11:30 AM
return num_rows and query results - by El Forum - 05-29-2009, 11:40 AM
return num_rows and query results - by El Forum - 05-29-2009, 11:56 AM
return num_rows and query results - by El Forum - 05-29-2009, 12:06 PM
return num_rows and query results - by El Forum - 05-29-2009, 12:09 PM
return num_rows and query results - by El Forum - 05-29-2009, 12:34 PM



Theme © iAndrew 2016 - Forum software by © MyBB