![]() |
row_array question - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: row_array question (/showthread.php?tid=69023) |
row_array question - muuucho - 09-28-2017 I have this function in a model_ Code: function get_one($where_clauses) 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? RE: row_array question - Narf - 09-28-2017 Check num_rows()? RE: row_array question - dave friend - 09-28-2017 Expanding on Narf's correct but very short reply PHP Code: function get_one($where_clauses) Or, using a ternary instead of an "if" PHP Code: function get_one($where_clauses) RE: row_array question - muuucho - 09-28-2017 (09-28-2017, 05:52 AM)Narf Wrote: Check num_rows()? ![]() |