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>