I have this function in a model_
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?
Code:
function get_one($where_clauses)
{
return $this->db->get_where('recipes', $where_clauses)->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?