public function fetchRow($mode = null)
    {
        $spec = $this->getResult();

        if( $mode === null ) {
            $mode = $this->getResultMode();
        }

        $data = null;
        switch( $mode ) {
            case self::FETCH_ASSOC:
                $data = $spec->fetch_assoc();
                break;
            case self::FETCH_COLUMN:
                if( ($row = $spec->fetch_row()) && is_array($row) ) {
                    $data = current($row);
                } else {
                    $data = null;
                }
                break;
            case self::FETCH_NUM:
                $data = $spec->fetch_row();
                break;
            case self::FETCH_OBJECT:
                if( null !== $this->resultClass ) {
                    if( null !== $this->resultParams ) {
                        $data = $spec->fetch_object($this->resultClass, $this->resultParams);
                    } else {
                        $data = $spec->fetch_object($this->resultClass);
                    }
                } else {
                    $data = $spec->fetch_object();
                }
                break;
        }

        $this->free();
        return $data;
    }
public function fetchRow($mode = null)
    {
        $spec = $this->getResult();

        if( $mode === null ) {
            $mode = $this->getResultMode();
        }

        $data = null;
        switch( $mode ) {
            case self::FETCH_ASSOC:
                $data = $spec->fetch_assoc();
                break;
            case self::FETCH_COLUMN:
                if( ($row = $spec->fetch_row()) && is_array($row) ) {
                    $data = current($row);
                } else {
                    $data = null;
                }
                break;
            case self::FETCH_NUM:
                $data = $spec->fetch_row();
                break;
            case self::FETCH_OBJECT:
                if( null !== $this->resultClass ) {
                    if( null !== $this->resultParams ) {
                        $data = $spec->fetch_object($this->resultClass, $this->resultParams);
                    } else {
                        $data = $spec->fetch_object($this->resultClass);
                    }
                } else {
                    $data = $spec->fetch_object();
                }
                break;
        }

        $this->free();
        return $data;
    }
public function fetchRow ( $ mode = null ) { $ spec = $ this -> getResult ( ) ; if ( $ mode === null ) { $ mode = $ this -> getResultMode ( ) ; } $ data = null ; switch ( $ mode ) { case self :: FETCH_ASSOC : $ data = $ spec -> fetch_assoc ( ) ; break ; case self :: FETCH_COLUMN : if ( ( $ row = $ spec -> fetch_row ( ) ) && is_array ( $ row ) ) { $ data = current ( $ row ) ; } else { $ data = null ; } break ; case self :: FETCH_NUM : $ data = $ spec -> fetch_row ( ) ; break ; case self :: FETCH_OBJECT : if ( null !== $ this -> resultClass ) { if ( null !== $ this -> resultParams ) { $ data = $ spec -> fetch_object ( $ this -> resultClass , $ this -> resultParams ) ; } else { $ data = $ spec -> fetch_object ( $ this -> resultClass ) ; } } else { $ data = $ spec -> fetch_object ( ) ; } break ; } $ this -> free ( ) ; return $ data ; }
Fetches a single result row

@param integer $mode This optional parameter is a constant indicating what
type of result should be produced from the current row data. The possible
values for this parameter are the constants FETCH_ASSOC, FETCH_OBJECT,
FETCH_COLUMN, or FETCH_NUM.
@return array|object
Fetches a single result row