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

[eluser]TheFuzzy0ne[/eluser]
I know that if you're using MySQL, in which case you're query will be something like this:
Code:
$query = $this->db->query('SELECT SQL_CALC_FOUND_ROWS * FROM my_table');

But you'll still have to run a:
Code:
$query = $this->db->query('SELECT FOUND_ROWS()');

It's certainly more efficient than running the query twice. This might work on other database platforms, but I'm not sure.


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