Executes a query and returns a value from the first row.

@param int $index zero-indexed column to fetch

@return mixed|bool result
193571
public function scalar($index = 0)
    {
        $stmt = $this->execute();

        if ($stmt) {
            return $stmt->fetchColumn($index);
        } else {
            return false;
        }
    }
1356387
public function getRow($index,$force=true){
		if($index<sizeof($this->rows)){
			$result=$this->rows[$index-1];
		}else if ($force){
			$this->setNumRows($index);
			$result=$this->rows[$index-1];
		}
		return $result;
	}
152578
public function searchValue($index): self
    {
        $this->generatorToArray();

        // init
        $return = [];

        if ($this->array === []) {
            return static::create(
                [],
                $this->iteratorClass,
                false
            );
        }

        // php cast "bool"-index into "int"-index
        if ((bool) $index === $index) {
            $index = (int) $index;
        }

        if (\array_key_exists($index, $this->array) === true) {
            $return = [$this->array[$index]];
        }

        return static::create(
            $return,
            $this->iteratorClass,
            false
        );
    }
485428
public static function get($index = null, $default = null)
	{
		return (func_num_args() === 0) ? $_GET : \Arr::get($_GET, $index, $default);
	}
525640
public function getRow($index)
    {
        $rows = $this->getRows();

        if (!isset($rows[$index])) {
            throw new NodeException(sprintf('Rows #%d does not exist in table.', $index));
        }

        return $rows[$index];
    }
391095
public function getChartByIndex($index = null)
    {
        $chartCount = count($this->chartCollection);
        if ($chartCount == 0) {
            return false;
        }
        if (is_null($index)) {
            $index = --$chartCount;
        }
        if (!isset($this->chartCollection[$index])) {
            return false;
        }

        return $this->chartCollection[$index];
    }
519117
public function get($index)
    {
        $index = intval($index);
        $i = 0;
        foreach ($this->getInnerIterator() as $v) {
            if ($i == $index) {
                return $v;
            }
            $i++;
        }

        return null;
    }
1144807
public function getQuery($index, $field, &$result) {
		$con = null;
		if (isset($this->queries[ $field ])) {
			$con = $this->queries[ $field ];
		} else if (method_exists($this->view, $field)) {
			$con = $this->view->{$field}();
			/**@var Query $query */
			list($query, $fk, $lk) = $con;
			$query->where([$fk => $result[ $index ][ $lk ]]);
			$this->queries[ $field ] = $con;
		}

		if ($con) {
			/**@var Query $query */
			list($query, $fk, $lk) = $con;
			if (isset($result[ $index ][ $lk ])) {
				$idv = $result[ $index ][ $lk ];
				$query->updateWhereData([$fk => $idv]);

				return $query;
			}
		}

		return null;
	}
486004
public function loadColumn($index = 0)
    {
        if ($this->stmt === null) {
            return null;
        }

        $columnList = array();
        while ($row = $this->stmt->fetch(\PDO::FETCH_NUM)) {
            $columnList[] = $row[$index];
        }
        return $columnList;
    }
854755
public function offsetGet($index)
    {
        if (parent::offsetExists($index)) {
            return parent::offsetGet($index);
        }
        if (isset(self::$global[$index])) {
            return self::$global[$index];
        }

        return null;
    }
458923
public function get(int $index, $default_val = null)
    {
        if ($this->offsetExists($index)) {
            return $this->offsetGet($index);
        }

        return $default_val;
    }
188864
public function get($index)
    {
        if (isset($this->callables[$index])) {
            return $this->callables[$index];
        }

        return $this->resolve($index);
    }
207730
protected function getIteratorByIndex($index = 0)
    {
        $runningCount = 0;
        foreach ($this->getArrayIterator() as $innerIt) {
            $count = count($innerIt);
            if ($index < $runningCount + $count) {
                return [$innerIt, $index - $runningCount];
            }
            $runningCount += $count;
        }

        return null;
    }
57558
public function getRow($index)
    {
        return isset($this->rows[$index]) ? $this->rows[$index] : null;
    }
810250
public function getValue($index = 0)
    {
        if ($index === 0 && $this->value === null) {
            return $this->defaultValue;
        }

        return (is_array($this->value) && array_key_exists($index, $this->value))
            ? $this->value[$index]
            : null;
    }
903830
public function get($index, $default = null)
	{
		if ($this->hasByIndex($index))
		{
			return $this->store[$index];
		}

		if ($default instanceof \Closure)
		{
			return $default($this);
		}

		return $default;
	}
801952
public static function get ($index)
    {
        $instance = self::getInstance();

        if (! $instance->ifKeyExists($index)) {
            throw new \Exception($index.' は登録されていません！');
        }

        return $instance->offsetGet($index);
    }