title: Pair two elements of a foreach loop
body: <p>I have a foreach loop (look, it's below), and I'm getting a few elements. When storing this data into MySQL, I want to select to which category (labeled here 'interaction[]') each 'count[]' belongs. For example, if row 1 has a count of 97, and those happen to be "chas", I can select "cha" from my dropdown, set it's value, and enter it into the table. Looking to do this for each instance of title[].</p>
  
  <p>Yes, the json part works. Yes, data is populated. Yes, I've searched. There are no errors. </p>
  
  <p>Hope this makes sense, and I really can't express my gratitude enough. I hope to one day be able to not ask these stupid questions but, hey, that's a ways off. Let me know if anything else needs to be clarified. </p>
  
  <pre><code>    foreach ($json-&gt;report-&gt;data as $key=&gt;$el) {
             ?&gt; 
             &lt;input type="hidden" value="&lt;?php echo $key; ?&gt;" name="row[]"&gt;
              &lt;?php
                  echo "&lt;tr&gt;&lt;td&gt;&lt;input name=\"title[]\" value=\"".$el-&gt;name."\" /&gt;".$el-&gt;name."&lt;/td&gt;
                  &lt;td&gt;&lt;input name=\"count[]\" value=\"".$el-&gt;counts[0]."\" /&gt;".$el-&gt;counts[0]."&lt;/td&gt;
                  &lt;td&gt;".$key."&lt;/td&gt;
                  &lt;td&gt;&lt;select name=\"interaction[]\"&gt;&lt;option value=\"blah\"&gt;blah&lt;/option&gt;&lt;option value=\"ha\"&gt;ha&lt;/option&gt;&lt;option value=\"cha\"&gt;cha&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;/tr&gt;";
          }
  </code></pre>