Welcome Guest, Not a member yet? Register   Sign In
Proper way to return sql results
#1

[eluser]GeXus[/eluser]
Hey guys, I've been handling my queries like this:

Code:
function getSomething(){
  
  $query = $this->db->query("QUERY");
  return ($query->result_array()) ? $query->result_array() : false;

}

By doing it this way (checking if its true first, then returning it) cause the query to be run twice? Would it be better to store the query in a variable, then do the check on that variable?


Messages In This Thread
Proper way to return sql results - by El Forum - 08-04-2010, 11:25 PM
Proper way to return sql results - by El Forum - 08-05-2010, 12:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB