Converting Oracle (OCI) Results to JSON with PHP

I normally use the PHP PDO to retrieve data from a MySQL database, and then convert the data to JSON after calling $statement->fetchAll(PDO::FETCH_ASSOC). This has worked well for me, and each row is converted into its own row in the JSON based on column name and value.

So, when I recently tried it with the OCI adapter ( oci_fetch_all($statement,OCI_ASSOC) ), the results turned out different than I expected. Rather than returning a result set of column names to values for each row, I ended up with an array of column names, each with their own array of values: