I have an oracle database, the format of it is:
table travel_request
(
request_id number(5) not null,
dbdirid number(15) not null,
origin varchar2(128) not null,
destination varchar2(128) not null,
depart_date date not null,
return_date date,
purpose varchar2(255) not null,
justification varchar2(255),
approval_status char(1)
);
I am trying to add a set of data to it from a form, then display the data from the database to verify it has been added correctly. The problem seems to occur when I add the data to the database, using the insert command. As the display section of code does not return any data from the database
Does anyone know the problem with my code? I have included the code below...
<?php
$dbh = db_connect($database_user,$database_password,$database_name);
$stmt = OCIparse($dbh,"insert into TRAVEL_REQUEST (request_id_sequence.nextval,$dbdirid,'$origin', '$destination' ,to_date('depart_date','DD-MM-YYYY'),to_date('return_date','DD-MM-YYYY'), '$purpose', '$justification', '$approval_status')");
OCIexecute($stmt,OCI_DEFAULT);
OCIlogoff($dbh);
?>
<?php
$dbh = db_connect($database_user,$database_password,$database_name);
$display = OCIparse($dbh, "select * from TRAVEL_REQUEST");
OCIexecute($display);
while(OCIFetchInto($display, $values))
{
$current_id=$values[1];
$current_dbdirid=$values[2];
$current_origin=$values[3];
$current_destination=$values[4];
$current_depart_date=$values[5];
$current_return_date=$values[6];
$current_purpose=$values[7];
$current_justification=$values[8];
$current_approval_status=$values[9];
echo "<tr><td>$current_id </td></tr>";
}
OCIlogoff($dbh);
?>