If I get records from my SQLite database’s master table like this:
$database = new PDO('sqlite:test.sqlite');
$sql = "SELECT * FROM sqlite_master";
$records = $database-> query($sql);
then it gives me double the amount of fields in each record, both indexed and associative:
type:[table]
0:[table]
name:[site_comments]
1:[site_comments]
tbl_name:[site_comments]
2:[site_comments]
rootpage:[3]
3:[3]
sql:[CREATE•TABLE•site_comments(author•varchar(50),•comment•varchar(255))]
4:[CREATE•TABLE•site_comments(author•varchar(50),•comment•varchar(255))]
I remember using the PDO object many years ago and there were fetchAll() et al. methods which was how you determined if you wanted both associative or indexed fields, or one or the other, etc. But this seems to be a new/different version of PDO (PHP installed with the newest version of XAMPP):

How do I tell the PDO object that I want it to give me only the named arrays, e.g. “type” and “name”, but not 0 and 1?
PDO::queryreturns aPDOStatement. UsePDOStatement::setFetchModeto set the default fetch mode, or pass the mode when callingfetchon the result. Note you set the fetch mode on the result after runningPDO::query, not on the PDO object before running the query.