title: how to do an sql query using values from a dynamic array?
body: <p>here is my array</p>
  
  <pre><code>Array
  (
      [0] =&gt; 31
      [1] =&gt; 36
      [2] =&gt; 41
  )
  </code></pre>
  
  <p>the 31,36, and 41 are id's of a record. the elements in this array can be from anywhere of 1 element to 10+ elements. the table structure looks something like this (shortened-version)</p>
  
  <pre><code>tbl_cart
  ---------
  id (auto-incremented)
  product_name
  price
  </code></pre>
  
  <p>what i'm trying to figure out is how can i do a query that will grab the id's listen in a dynamically created array then accumulate the price for each respected id and display the output?</p>
  
  <p>thanks, let me know if this doesnt make sense.</p>