PHP / mySQL output via javascript and dropdown
<p>Here is what I have in php:</p>

<pre><code>[Color, Size, Status]
Red, Small, 1
Red, Large, 0
Blue, Small, 1
Blue, Large, 1
</code></pre>

<p>I can get that output in php just fine like mentioned above. What I want to do is get this structured properly for dropdown in html and javascript/jquery (please continue reading for javascript purpose).</p>

<p>Basically there would be 2 dropdowns. One for Size and one for Color. The reason for javascript (preferably jquery) is to check the status. 1 means in stock and 0 for out of stock. So if someone were to select the combination of Red Color in Large Size it would be status of 0 (meaning out of stock)</p>

<p>I have been struggling on how to do this for few hours. Any help is much appreciated!!</p>

<p>----== UPDATE ==----</p>

<p>I have found a way to do this, but different than I had initially wanted to (using an array or ojbect in javascript)</p>

<p>Anyhow, my solution is posted here: <a href="http://jsbin.com/osipe5/2" rel="nofollow">http://jsbin.com/osipe5/2</a></p>

<p>Basically I output a bunch of combinations in a hidden input and then use the javascript to read them and update the text of the select options</p>
