Multidimensional MySQL result – subqueries as arrays
<p>MySQL query:</p>

<pre><code>SELECT
    seats,
    ( SELECT tires, bumpers FROM exterior ) AS stuff
FROM
    interior
</code></pre>

<p>The result I was expecting:</p>

<pre><code>0 =&gt; [
    'seats' =&gt; 'comfort',
    'stuff' =&gt; [
        0 =&gt; [
            'tires' =&gt; 'winter',
            'bumpers' =&gt; 'front'
        ],
        1 =&gt; [
            'tires' =&gt; 'summer',
            'bumpers' =&gt; 'back'
        ],
        ...
    ]
],
1 =&gt; ...
</code></pre>

<p>However, this did not work. Error message: <em>Operand should contain 1 column(s)</em>.</p>

<p>Is possible to get the subquery results returned as arrays, the way/format the base query is? Or grouping it this way is only possible with e.g. PHP? Thanks.</p>