Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OCI Execute Error

Status
Not open for further replies.

Delboy14

Programmer
Jun 21, 2001
213
0
0
GB
I am having problems adding records to my database, the insert statement seems to work ok, but I have an error when the execute command is reached.

does anyone know where my problem is?

<?php
//try first to connect to the database. if we can't then end

$dbh = db_connect($database_user,$database_password,$database_name);
$stmt = OCIparse($dbh,&quot;insert into TRAVEL_REQUEST values(request_id_sequence.nextval,$dbdirid,'$origin', '$destination' ,
to_date($depart_date,'DD-MM-YYYY:hh24:mi:ss'),to_date($return_date,'DD-MM-YYYY:hh24:mi:ss'), '$purpose', '$justification',
'$approval_status')&quot;);

if($stmt==false)
{
echo OCIError($stmt).&quot;<br>&quot;;
echo &quot;error in insert&quot;;
exit;
}

$execute=OCIexecute($stmt,OCI_DEFAULT);
ocicommit($dbh);

if($execute==false)
{
echo OCIError($execute).&quot;<br>&quot;;
echo &quot;error in execute&quot;;
exit;
}
OCIlogoff($dbh);
?>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top