• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
row_array question

#1
I have this function in a model_
Code:
function get_one($where_clauses)
   {
       return $this->db->get_where('recipes', $where_clauses)->row_array();
   }
If I, by mistake, pas in where_clauses that returns more than one row only the first row is returned since I am using row_array().
However, is there a way to get a warning (like return false) if more than one row is fetched?

I could use result_array and count the rows, but then I get multidimensional array in return.
Any better solution?
Reply


Messages In This Thread
row_array question - by muuucho - 09-28-2017, 05:23 AM
RE: row_array question - by Narf - 09-28-2017, 05:52 AM
RE: row_array question - by muuucho - 09-28-2017, 08:00 AM
RE: row_array question - by dave friend - 09-28-2017, 06:55 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.