hi all, can someone please help out.i am using php to insert data into an oracle 11g database.i have a table bus which has a foreign key franchisee name,i want when i am filling in the form,at the text box containing the franchisee name instead of inputting anything i have a drop down fetched from the db from which i can select the franchisee name and submit the form.the code i am using is shown below,it is nt giving me any result..if u can pliz help
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
// If submit button has been pressed.....
if (isset($_POST['submit']))
{
// Connect to the database
$c = @oci_connect('scott','tiger')
or die("Could not connect to Oracle server !!");
// Retrieve the posted new bus information.
$fleet_number = $_POST['fleet_number'];
$registration_number = $_POST['registration_number'];
$model= $_POST['model'];
$franchisee_id= $_POST['franchisee_id'];
// Insert the bus information into the Bus table
$s = oci_parse($c, "insert into bus(fleet_number,registration_number,model,franchisee_name)
$fran = mysql_query("SELECT * FROM franchisee");
echo '<select name="franchisee_name" TABINDEX="18"><OPTION>';
echo "</OPTION>";
while ($row_item = mysql_fetch_array($franchisee_name)){
$fname = $row_item["fname"];
echo "<OPTION value=\"$fname\">$fname</OPTION>";
}
echo '</SELECT>';
values('$fleet_number','$registration_number','$model','$franchisee_id')");
$result = oci_execute($s);
// Display an appropriate message on either success or failure
if ($result)
{
echo "<p>Bus successfully inserted!</p>";
//oci_commit($C);
}
else
{
echo "<p>There was a problem inserting the Bus!</p>";
var_dump(oci_error($s));
}
oci_close($c);
}
// Include the isertion form
include "insertbus.php";
?>