Line 30 is OCI_execute($sql_id, OCI_DEFAULT);
I have an html document where a user is asked to input the FirstName, LastName, ArtistID, nationality, DateofBirth. After they input it, and submit it, the inputs should be pointed to the PHP document below. I'm not sure why I'm getting the error.
HTML document
<body><center>
<p> This form submits user input to a php script file called OraclePHP-5, the PHP script inserts a new record into the Artist table and shows a message. </p>
<form name = "form1" method="post" action="OraclePHP-5.php">
<p>Artist First Name:
<input type="text" name="inputName">
</p>
<p>Artist Last Name:
<input type="text" name="inputLName">
</p>
<p>Artist ID:
<input type="text" name="inputID">
</p>
<p>Nationality:
<input type="text" name="inputNation">
</p>
<p>Birth Year:
<input type="text" name="inputYear">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
<p> </p>
</form>
<p> </b>
</body>
PHP document Error on line 30: OCI_execute($sql_id, OCI_DEFAULT);
<html>
<head>
<title>Class Assignment</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</head>
<body><center>
<?php
putenv("ORACLE_HOME=/export/home/oracle/app/oracle/product/11.1.0/db_1");
putenv("LD_LIBRARY_PATH=/export/home/oracle/app/oracle/product/11.1.0/db_1/lib");
$connection = OCILogon("xxxxxx","xxxxxx","xxxxxx");
if (!$connection) {
echo "Couldn't make a connection!";
exit;
} else {echo "You have connected to the UIS Oracle Database!! <p>";}
$sqlquery = ("Insert INTO ARTIST(FirstName, LastName, ArtistID, nationality, DateofBirth)
Values('".$inputName."','".$inputLName."',".$inputID.",'".$inputNation."',".$inputYear.")");
$sql_id = oci_parse($connection, $sqlquery);
if (!$sql_id){
$e=oci_error($connection);
print htmlentities($e['message']);
exit;
}
OCI_execute($sql_id, OCI_DEFAULT);
OCI_commit($connection);
OCI_Free_Statement($sql_id);
OCI_Close($connection);
?>
</body>