title: mysql query for each of the values of an array
body: <pre><code>for ($i=0; $i&lt;=$gsayi-1; $i++)
    {
      $a[] = mysql_result($aylik,$i);
    }
  foreach ($a as $value)
    {
      $m = mysql_query("SELECT puan FROM sorular WHERE ID = $value");
      echo $m; 
    }
  </code></pre>
  
  <p>a[ ] array is</p>
  
  <p>2,2,1</p>
  
  <p>I am trying to execute a mysql query with each of that values. I am using that values as ID.</p>
  
  <p>I tried foreach loop but it shows me <code>Resource id #7Resource id #7</code></p>
  
  <p>How can I solve this problem?</p>