public function getValue($sql, $input_array=array(), $which_connection='')
    {
        $res = $this->execute($sql, $input_array, $which_connection);
        if ($res && $this->numRows($res) > 0) {
            $row = $this->fetchRow($res);
            return $row[0];
        } elseif ($res && $this->numRows($res) == 0) {
            return false;
        } else {
            if ($this->throw_on_fail) {
                throw new \Exception('Record not found');
            } else {
                return false;
            }
        }
    }
public function getValue($sql, $input_array=array(), $which_connection='')
    {
        $res = $this->execute($sql, $input_array, $which_connection);
        if ($res && $this->numRows($res) > 0) {
            $row = $this->fetchRow($res);
            return $row[0];
        } elseif ($res && $this->numRows($res) == 0) {
            return false;
        } else {
            if ($this->throw_on_fail) {
                throw new \Exception('Record not found');
            } else {
                return false;
            }
        }
    }
public function getValue ( $ sql , $ input_array = array ( ) , $ which_connection = '' ) { $ res = $ this -> execute ( $ sql , $ input_array , $ which_connection ) ; if ( $ res && $ this -> numRows ( $ res ) > 0 ) { $ row = $ this -> fetchRow ( $ res ) ; return $ row [ 0 ] ; } elseif ( $ res && $ this -> numRows ( $ res ) == 0 ) { return false ; } else { if ( $ this -> throw_on_fail ) { throw new \ Exception ( 'Record not found' ) ; } else { return false ; } } }
Get a value directly from a query without verifying
rows exist and fetching one
@param $sql a value from SQLManager::prepare
@param $input_array an array of values
@param which_connection see method close
@return [mixed] value or [boolean] false
- throws an exception if exceptions are enabled
Get a value directly from a query without verifying rows exist and fetching one