Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14115

row_array question

$
0
0
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?

Viewing all articles
Browse latest Browse all 14115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>