title: using implode for array inside mysql where in clause
body: <p>im trying to use array for mysql where in clause</p>
  
  <pre><code>$result= $myDB-&gt;query("SELECT sum(total) as total FROM ".$myDB-&gt;prefix("mydata")." WHERE categoryname IN ('".$categoryname."') AND year='$year' AND stat_id='$stat_id'");
  </code></pre>
  
  <p>current ouput for the categoryname is</p>
  
  <pre><code>('Cat1,Cat2,Cat3')
  </code></pre>
  
  <p>desired output</p>
  
  <pre><code>('Cat1','Cat2','Cat3')
  </code></pre>
  
  <p>i tried it like so far but its not working</p>
  
  <pre><code>$categoryname_new = implode(',',$categoryname);
  
  $result= $myDB-&gt;query("SELECT sum(total) as total FROM ".$myDB-&gt;prefix("mydata")." WHERE categoryname IN ('".$categoryname_new."') AND year='$year' AND stat_id='$stat_id'");
  </code></pre>