public function selectArrayIndexed($q, $args = array())
    {
        $this->exec($q, $args);
        if ($this->_sth) {
            $result = array();
            while ($row = $this->_sth->fetch(\PDO::FETCH_ASSOC)) {
                $result[$row[key($row)]] = $row;
            };
            return $result;
        } else {
            return false;
        };
    }
public function selectArrayIndexed($q, $args = array())
    {
        $this->exec($q, $args);
        if ($this->_sth) {
            $result = array();
            while ($row = $this->_sth->fetch(\PDO::FETCH_ASSOC)) {
                $result[$row[key($row)]] = $row;
            };
            return $result;
        } else {
            return false;
        };
    }
public function selectArrayIndexed ( $ q , $ args = array ( ) ) { $ this -> exec ( $ q , $ args ) ; if ( $ this -> _sth ) { $ result = array ( ) ; while ( $ row = $ this -> _sth -> fetch ( \ PDO :: FETCH_ASSOC ) ) { $ result [ $ row [ key ( $ row ) ] ] = $ row ; } ; return $ result ; } else { return false ; } ; }
Fetch all results in an associative array, index by first column

Whereas selectArray() returns a list of associative rows, this returns
an associative array keyed on the first column of each row.

@param string $q    SQL query with '?' value placeholders
@param array  $args (Optional) List of values corresponding to placeholders

@return array All associative rows, keyed on first column
Fetch all results in an associative array index by first column