title: query WHERE id='.$_GET['selected"] not working as intended
body: <p>I need to allow my user to choose an option value in a dropdown list, upon which the page will refresh and columns from the DB will be update on the page. How can I set this behavior?</p>
  
  <pre><code> &lt;script language="JavaScript"&gt;
          // this js autorehresh page if option was change
  
          function MM_jumpMenu(targ,selObj,restore){ //v3.0
          eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
          if (restore) selObj.selectedIndex=0;
          }
          &lt;/script&gt;
  
       &lt;?php
            //at first we must connect to DB
            //external
       require ('connectDB.php');
       ?&gt;
  
       &lt;form method="post"&gt;
          &lt;select name="selected" onChange="MM_jumpMenu('parent',this,1)"&gt;
          &lt;?php
          **// echo all id in table to options dropdown menu**
            $sql='SELECT id FROM lekcia1';
              $result=mysql_query($sql) or die(mysql_error($db));
              $a = 0;
              while ($recording=mysql_fetch_array($result)){
                $a ++;
                echo '&lt;option value="'.$recording['selected'].'"&gt; '.$a.' &lt;/option&gt;';
              };
            ?&gt;
          &lt;/select&gt;
        &lt;/form&gt;
  
        **&lt;?php
          // query NOT WORK 
          $sql1='SELECT * FROM lekcia1 WHERE id='.$_GET['']; // Notice: Undefined index: selected
          $result1=mysql_query($sql1) or die(mysql_error($db));
          $recording1=mysql_fetch_array($result1);
        ?&gt;**
  
        &lt;ul&gt;
          &lt;li&gt;&lt;?php echo $recording1['column1'];?&gt;&lt;/li&gt;
          &lt;li&gt;&lt;?php echo $recording1['column2'];?&gt;&lt;/li&gt;
          &lt;li&gt;&lt;?php echo $recording1['column3'];?&gt;&lt;/li&gt;
        &lt;/ul&gt;
  </code></pre>