I know that there are currently questions on SO already pertaining to saving jQuery sortable lists to a database. How can I query my 2 tables, grab the "order" string, and then display the sortable list in the correct order. My tables are:
Table name: clothing_category
id name order
-----------------------------------------
5 Headwear 29,22,26
And:
Table name: clothing_type
id name clothing_id (relational with to 'clothing_category')
-----------------------------------------
22 Hat 5
26 Beanie 5
29 Visor 5
So, seeing as how the "order" of headwear is stored as `29,22,26', I would want the HTML to output like this:
<ul id="sortable">
<li id="29">Visor</li>
<li id="22">Hat</li>
<li id="26">Beanie</li>
</ul>
How can I display it like above? And is my method of storing the order a good way to do this?