How to convert mysql array result into new array for json encoding
<p>I can’t seem to get the result I need.  Here is the array as it is provided by the sql query:</p>

<pre><code>Array (
 [0] =&gt; Array ( 
     [id] =&gt; 7
     [description] =&gt; Accepted )
 [1] =&gt; Array ( 
     [id] =&gt; 8
     [description] =&gt; Declined )
 [2] =&gt; Array (
     [id] =&gt; 11 
     [description] =&gt; Deferred ) 
     )
</code></pre>

<p>Here is the format for how I need to have it foreach of the objects listed above:</p>

<pre><code>['7'][‘7’] = “Accepted”;
['7'][‘8’] = “Declined ”;
['7'][‘11’] = “Deferred”;
</code></pre>

<p>...where the first array[‘7’] is an added value and needed for each object.</p>

<p>Seems easy enough, but the foreach statements I created return an error “cannot use scalar value as an array”</p>
