title: Replace mysql coloumn values when adding them to an php array
body: <p>I have a table called "Current state", it has three columns known as:</p>
  
  <pre><code>id  name    state
  1   FXD     1
  2   GFX     3
  3   ATOM    2
  4   FARB    3
  5   REX     1
  6   FRX     2
  </code></pre>
  
  <p>In the following code I get it into array and print it:</p>
  
  <pre><code>$exc = $conn-&gt;prepare("SELECT name,state from current_state");
          $exc-&gt;execute();
              while($finalResult = $exc-&gt;fetch(PDO::FETCH_ASSOC))
               {
                          $tables[] = $finalResult;
               }
  var_dump($tables);
  </code></pre>
  
  <p>But the problem is though numbers represent the state column values each of those numbers have a meaning:</p>
  
  <pre><code>1 = running
  2 = finished
  3 = dimnished
  </code></pre>
  
  <p><strong>So what I want is to add the above string values right away to the tables array by comparing the values of the state column.</strong></p>
  
  <p>The current print result of a column would look like</p>
  
  <pre><code>array (size=2)
    'name' =&gt; string 'FRX' (length=11)
    'state' =&gt; string '2' (length=1)
  </code></pre>
  
  <p>But what I want is:</p>
  
  <pre><code>array (size=2)
        'name' =&gt; string 'FRX' (length=11)
        'state' =&gt; string 'finished' (length=8)
  </code></pre>