Use PHP to get rows from SQL and add li elements to a ul for each row
<p>I am pretty new to this so just trying to figure something out. 
My overall goal is to create a drop down menu in my navbar that shows themes and when you click on an element it changes the color theme of the page. 
In my database I have 2 tables. One that lists the theme and an Id for the theme and another table that has the hex codes related to that theme. </p>

<p>Ordered as such:</p>

<p>themes table:</p>

<p>ID | Theme</p>

<p>colors table:   (Theme ID and ID in themes table are the same)</p>

<p>ID | Theme ID | hex Code</p>

<p>I am trying to break this down into steps:</p>

<ol>
<li>retrieve theme names from SQL and make a new li in my ul for each row in the table</li>
<li>When the li for a theme is clicked, retrieve hex codes for the theme colors  from the colors table as php variables.</li>
<li>(The stylesheet is a .php document with php variables used to assign colors to various css tags on the page). Use php variables from the previous step to change the variable values in this file ultimately changing the color scheme (theme) of the page.</li>
</ol>

<p>If there is a smarter way to do this I would love to know about it.The trouble I am having right now is. I am new to PHP and I don't know how to do step 1. I think I can manage steps 2-3 but I can't find anything on how to add an li to a drop down list for each row retrieved.</p>

<pre><code>         &lt;li&gt;themes
            &lt;ul&gt;
              &lt;!-- add theme names here --&gt;
            &lt;/ul&gt;         
         &lt;/li&gt;
</code></pre>