Welcome Guest, Not a member yet? Register   Sign In
row_array question
#3

Expanding on Narf's correct but very short reply

PHP Code:
function get_one($where_clauses)
{
 
      $query $this->db->get_where('recipes'$where_clauses);
 
      if($query->num_rows() > 1)
 
      {
 
          return FALSE;
 
      }
 
      return $query->row_array();


Or, using a ternary instead of an "if"

PHP Code:
function get_one($where_clauses)
{
 
      $query $this->db->get_where('recipes'$where_clauses);
 
      return $query->num_rows() > FALSE $query->row_array();

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



Theme © iAndrew 2016 - Forum software by © MyBB