fetch one column from all rows

@return array [value1, value2, ...]
974829
public function fetchAllColumn(string $sql, array $params = [], array $types = []): array
    {
        $stmt = $this->conn->executeQuery($sql, $params, $types);

        return $stmt->fetchAll(PDO::FETCH_COLUMN);
    }
844214
protected function getNextRow()
    {
        # If the result resource is invalid then don't bother trying to fetch
        if (!$this->result) {
            return;
        }

        switch ($this->mode) {

            case "mysql":
                $row = $this->result->fetch_assoc();
                break;

            case "postgres":
            case "redshift":
                $row = pg_fetch_assoc($this->result);
                break;

            case "odbc":
                $row = odbc_fetch_array($this->result, $this->position + 1);
                break;

            case "sqlite":
                $row = $this->result->fetchArray(SQLITE3_ASSOC);
                break;

            case "mssql":
                $row = mssql_fetch_assoc($this->result);
                break;

            case "mssqlsrv":
                sqlsrv_fetch($this->result, SQLSRV_SCROLL_ABSOLUTE, $this->position);
                $row = sqlsrv_fetch_array($this->result, SQLSRV_FETCH_ASSOC);

                if ($row) {
                    foreach ($row as &$value) {
                        if ($value instanceof \DateTime) {
                            $value = $value->format(\DateTime::ISO8601);
                        }
                    }
                }
                unset($value);
                break;
        }

        # If the fetch fails then there are no rows left to retrieve
        if (!$row) {
            return;
        }

        $this->position++;

        return $row;
    }
338025
public function toArray()
    {
        $rowData = array();
        foreach ($this->cells as $cell) {
            $rowData[] = $cell->getValue();
        }
        
        return $rowData;
    }
1144850
public function fetchAll()
    {
        $query = sprintf('SELECT * FROM `%s`', $this->table);
        $result = array();

        foreach ($this->pdo->query($query) as $key => $value) {
            $result[$key] = $value;
        }

        return $this->parse($result);
    }
288392
public function getColumns()
	{
		$return = $this->columns;

		try {
			$this->getParent();

			if (!$this->getSessionData('_grid_hidden_columns_manipulated', false)) {
				$columns_to_hide = [];

				foreach ($this->columns as $key => $column) {
					if ($column->getDefaultHide()) {
						$columns_to_hide[] = $key;
					}
				}

				if (!empty($columns_to_hide)) {
					$this->saveSessionData('_grid_hidden_columns', $columns_to_hide);
					$this->saveSessionData('_grid_hidden_columns_manipulated', true);
				}
			}

			$hidden_columns = $this->getSessionData('_grid_hidden_columns', []);

			foreach ($hidden_columns as $column) {
				if (!empty($this->columns[$column])) {
					$this->columns_visibility[$column] = [
						'visible' => false,
					];

					unset($return[$column]);
				}
			}

		} catch (DataGridHasToBeAttachedToPresenterComponentException $e) {
		}

		return $return;
	}
311691
public function getRows()
    {
        $rows = [];
        $wheres = $this->queryBuilder->wheres ?: [];

        foreach ($wheres as $where) {

            // Skip unsupported clauses
            if (!isset($where['column'])) {
                continue;
            }

            // If it doesn't contain the table name assume it's the "FROM" table
            if (strpos($where['column'], '.') === false) {
                $where['column'] = implode('.', [$this->queryBuilder->from, $where['column']]);
            }

            list($table, $column) = $this->splitTableAndColumn($where['column']);

            // Make sure that the where clause applies for the primary key column
            if ($column !== self::PRIMARY_KEY_COLUMN) {
                continue;
            }

            // Initialize a set for the current table
            if (!isset($rows[$table])) {
                $rows[$table] = [];
            }

            // Add the rows to the current table set
            if ($where['type'] === 'Basic') {
                if ($where['operator'] === '=' && is_numeric($where['value'])) {
                    $rows[$table][] = $where['value'];
                }
            }
            else if ($where['type'] === 'In') {
                $rows[$table] += $where['values'];
            }
        }

        return $rows;
    }
300695
public function getColumns()
    {
        if (empty($this->columns) && !empty($this->data)) {
            //parse columns from data
            $tmp = array_keys(current($this->data));
            return array_combine($tmp, $tmp);
        }

        return $this->columns;
    }
1084225
public function get(array $columns = [])
    {
        if (count($columns) > 0) {
            $this->select($columns);
        }

        // Execution of request.
        $sql = $this->toSql();

        $stmt = $this->connection->prepare($sql);

        $this->bind($stmt, $this->where_data_binding);

        $this->where_data_binding = [];
        $stmt->execute();

        $data = Sanitize::make($stmt->fetchAll());

        $stmt->closeCursor();

        if (!$this->first) {
            return $data;
        }
   
        $current = current($data);
        
        $this->first = false;

        if ($current == false) {
            return null;
        }

        return $current;
    }
855802
public static function fetch($tables)
    {
        foreach ($tables as $table) {
            $result = Driver::query("SELECT * FROM $table", Driver::INDEX);
            $fields = $result->columnCount();
            $rows = $result->rowCount();
            $data = Driver::read("SELECT * FROM $table", Driver::INDEX);
            //
            $content = (!isset($content) ? '' : $content).self::stucture($table);
            //

            $st_counter = 0;
            foreach ($data as $row) {
                if ($st_counter % 100 == 0 || $st_counter == 0) {
                    $content .= "\n-- Table Data\nINSERT INTO ".$table.' VALUES';
                }
                //
                $content .= "\n(";
                //
                for ($j = 0; $j < $fields; $j++) {
                    $row[$j] = str_replace("\n", '\\n', addslashes($row[$j]));
                    //
                    if (isset($row[$j])) {
                        if (!empty($row[$j])) {
                            $content .= '"'.$row[$j].'"';
                        } else {
                            $content .= 'NULL';
                        }
                    }
                    //
                    else {
                        $content .= '""';
                    }
                    //
                    if ($j < ($fields - 1)) {
                        $content .= ',';
                    }
                }
                //
                $content .= ')';
                //
                if ((($st_counter + 1) % 100 == 0 && $st_counter != 0) || $st_counter + 1 == $rows) {
                    $content .= ';';
                }
                //
                else {
                    $content .= ',';
                }
                //
                $st_counter = $st_counter + 1;
            }

            $content .= "\n\n\n";
        }

        return $content;
    }
922170
public function get(): array
    {
        try {
            $rows = $this->baseQuery->get();
            return array_map([$this, 'processFetchedRow'], $rows);
        } catch (\Throwable $exception) {
            return $this->handleException($exception);
        }
    }
637395
public function fetchRow()
    {
        $sth = $this->execute();
        $db = $this->db;

        return $sth->fetch($db::FETCH_ASSOC);
    }
1173084
public function getDirtyColumns()
    {
        $ret = array_keys($this->_cleanData);
        foreach ($this->_getSiblingRows() as $r) {
            $ret = array_merge($ret, $r->getDirtyColumns());
        }
        return $ret;
    }
855363
public function getAll()
    {
        $sql = "SELECT * FROM `$this->_table`";
        $this->__init_database();

        if ($stmt = $this->db->prepare($sql)) return $this;

        $this->result = $stmt->fetchAll(MySQL::FETCH_OBJ);

        return $this;
    }
1173878
public function getRowAndColumnCount()
    {
        $rows = $columns = 0;
        $trs = $this->getElementsByTagName('tr');
        foreach ($trs as $tr) {
            /** @var \DOMElement $tr */
            $rowspan = $tr->getAttribute('rowspan');
            $rows += ($rowspan || 1);

            // Now look for column-related info
            $columnsInThisRow = 0;
            $cells = $tr->getElementsByTagName('td');
            foreach ($cells as $cell) {
                /** @var \DOMElement $cell */
                $colspan = $cell->getAttribute('colspan');
                $columnsInThisRow += ($colspan || 1);
            }
            $columns = max($columns, $columnsInThisRow);
        }

        return ['rows' => $rows, 'columns' => $columns];
    }
515727
public function getColumnNames()
    {
        $columns = array();
        foreach ($this->childs as $column) {
            $columns[] = $column->getColumnName();
        }

        return $columns;
    }
375752
public function values($column = 0)
    {
        if (is_int($column)) {
            $column = $this->rows ? array_keys($this->rows[0])[$column] : '';
        }

        return array_map(function ($row) use ($column) {
            return $row[$column];
        }, $this->rows);
    }
1328512
public function fetch()
	{
		if(count($this->select->getColumns()) === 0)
		{
			/** @var Column $column */
			$column = $this->factory->references('Column', '*');
			$this->select->column($column);
		}
		$query    = $this->factory->builder($this->select)->process();
		$queryObj = $this->pdo->query($query);
		if($queryObj)
		{
			return $queryObj->fetchAll(\PDO::FETCH_ASSOC);
		}

		return array();
	}