title: Using PHP to remove a selected item from drop down, amongst others
body: <p>Hiya:
  I'm trying to use PHP to remove selected item in a drop down menu, but all to know avail. Also, when I click on the same submit button that I'll use to remove selected list, I want to UPDATE the MySQL database. I tried using JavaScript, but couldn't use both languages on that submit input button.</p>
  
  <p>This is my code for creating the drop down menu and button</p>
  
  <pre><code>$opts        = array("guns", "knives", "ammo");
  $selected    = array($_POST['selectMenu']);
  $revisedOpts = array_diff($opts, $selected);
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;select name='selectMenu'&gt;
  &lt;?php
  foreach($revisedOpts as $v) {
       echo "&lt;option&gt;".$v."&lt;/option&gt;";
  }
  ?&gt;
  &lt;/select&gt;&lt;input name="Collect" type="submit" value="submit" /&gt;
  </code></pre>
  
  <p>This is the mysql_query</p>
  
  <pre><code>if (isset($_POST['Collect'])) {
      mysql_query("UPDATE Player SET score = score+10
                   WHERE name = 'Rob Jackson' AND rank = 'Lieutenant'");
  }
  </code></pre>