title: PHP Get value from drop down option (int) type
body: <p>I'm having problem with capturing the value from drop down list. This is my code for drop down list which is product id.</p>
  
  <pre><code>&lt;select name="id" id="id" ONCHANGE="location =this.options[this.selectedIndex].value;" &gt;
  &lt;option value="---"&gt;---&lt;/option&gt;
  &lt;?php
      foreach( $products as $ID =&gt; $info ){
      echo '&lt;option value="new_purchase.php?id=' . $ID . '"';
      echo isset( $id ) &amp;&amp; $id == $ID ? ' selected="selected"' : '';
      echo '&gt;' . $info['id'] . '&lt;/option&gt;'; }                                                         
                          ?&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>And this is my code for capture the value.</p>
  
  <pre><code> $id = $mysqli-&gt;real_escape_string ($_POST['$("#id:selected").val()'] );
  </code></pre>
  
  <p>The query run but it stores 0 as product id value no matter what I chose.</p>
  
  <p>Any helps would be appreciated.</p>