0

Second query not work...

 <form method="post">
    <select name="selected" onChange="MM_jumpMenu('parent',this,1)">
    <?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 '<option value="'.$recording['selected'].'"> '.$a.' </option>';
        };
      ?>
     </select>
   </form>

     <?php
    // query NOT WORK
    $sql1="SELECT * FROM lekcia1 WHERE id='".$_POST['selected']."'"; // Notice: Undefined index:selected
    $result1=mysql_query($sql1) or die(mysql_error($db));
    $recording1=mysql_fetch_array($result1);
  ?>


  <ul>
    <li><?php echo $recording['nazov_lekcie'];?></li>
    <li><?php echo $recording['cislo_ulohy'];?></li>
    <li><?php echo $recording['nazov_ulohy'];?></li>
  </ul>
3
Contributors
5
Replies
12
Views
2 Years
Discussion Span
Last Post by imti321
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.