title: trying to put an mysql result into a string
body: <p>I'm trying to put an mysql query result into an string
  I tried to find an answer but all the similar posts were getting subquery answers which is not what I'm trying to do.</p>
  
  <p>for example</p>
  
  <pre><code>    +----------------------------------+
      |            Fruits_tbl            |
      +----+---------+---------+---------+
      | ID |  Fruit  |  Color  |  Number |
      +----+---------+---------+---------+
      |  1 |  Orange |  Orange |    3    |
      |  2 |  Apple  |  Red    |    5    |
      +----+---------+---------+---------+
  
  
  
      $sql = "select Fruits,Color,Number from Fruits_tbl where ID = 2";
      $result = $pdo-&gt;query($sql);
      $row = $result-&gt;fetch();
      print_r($row);
  </code></pre>
  
  <p>This will give me something like <br>
  Array([0]=>"Apple", [1]=>"Red", [2]=>"5", [Fruit]=>"Apple", [Color]=>"Red", [Number]=>"5")</p>
  
  <p>implode will give me 2 of each<br>
  I want just need a string = "Apple, Red, 5"<br></p>
  
  <p>what I currently have is</p>
  
  <pre><code>$string = $row['Fruit'].", ".$row['Color'].", ".$row['Number']
  </code></pre>
  
  <p>As you can see that's rather tedious. <br>
  Is there something like implode but only return the index array or something?</p>