title: array to string conversion error, need to explode and then implode
body: <p>I want to explode an array, read each value and print them back in an array...</p>
  
  <p>I dont understand where i am getting wrong. Please help me..this is my code..</p>
  
  <p>I am getting an array to string conversion error</p>
  
  <pre><code>$query="SELECT categories FROM shops";
  $result = mysql_query($query);  
  while($column = mysql_fetch_assoc($result)){
      $categories=explode(",",$column['categories']);
      foreach($categories as $value){
          $new_query="SELECT name from categories where id='$value'";
          $name = mysql_query($new_query);    
          $name_column= mysql_fetch_assoc($name);
          array_push($shops_list,$name_column);
  
      }
  }
  echo implode(",",$shops_list);
  </code></pre>