The following code gives me an array $a
containing description
.
$stmt = $dbh->prepare("SELECT description, id
FROM money_items");
$stmt->execute();
$a = $stmt->fetchAll(PDO::FETCH_COLUMN, 0);
$id = $stmt->fetchAll(PDO::FETCH_COLUMN, 1);
But the $id
array comes out blank.
Array
(
)
If I remove the $a = $stmt->fetchAll(PDO::FETCH_COLUMN, 0);
line, the $id
array comes out fine. Am I only allowed to fetch one column from the results?