Home » Open Source » Programming Interfaces » Drop Down Boxes
Drop Down Boxes [message #398856] Sat, 18 April 2009 09:48
cupramen
Messages: 1
Registered: April 2009
Junior Member
Hello i am novice when it comes to php and i have been trying to create a drop down box where data from my oracle data base is populated into that box.

Here is my code, i am able to get the drop down box but there are no values in the box

    <?php
   $c = oci_connect('hr', 'hr')
        or die('Could not connect to Oracle server');

    $stmt = oci_parse($c, 'SELECT flight_number FROM flight_schedules');
   oci_execute($stmt, OCI_DEFAULT);
    ?>
    <form action="test2.php" method="post">
       <select name="flight_number">
            <option value="0"></option>
           <?php
          while (oci_fetch($stmt)) {
               printf('<option value="$stmt">%1$s</option>'
                    , oci_result($stmt, 'flight_number'));
          }
          ?>
       </select>
   </form> 
Previous Topic: OCILOGON
Next Topic: Call a php, give values with method=GET
Goto Forum:
  


Current Time: Sat Dec 03 17:55:57 CST 2016

Total time taken to generate the page: 0.08444 seconds