title: PHP While - SELECT html tag
body: <p>I have an issue, I just cannot solve. I have a PHP script, which loops my membership packages from my database. I have now 5 membership packages, to 3 different memberships.</p>
  
  <p>I want a SELECT option. So users can select what package they want, to each membership.</p>
  
  <p>But when I tries to do a while loop, and loop it out, it just loops out ALL 5 membership packages. I want 3 SELECTs, with the membership package details inside.</p>
  
  <p>My current code:</p>
  
  <pre><code>                                &lt;?php
                                  $p=mysql_query("SELECT * FROM membership_packages");
                                  while($mp = mysql_fetch_assoc($p)):
                                      echo '      &lt;select&gt;
                                                  &lt;option&gt;'.$mp['duration'].' Days&lt;/option&gt;
                                                   &lt;/select&gt;
                                            ';
  
                                  endwhile;
                              ?&gt;
  </code></pre>