第30行是OCI_execute($ sql_id,OCI_DEFAULT);
我有一个html文档,要求用户输入FirstName,LastName,ArtistID,国籍,DateofBirth。在输入并提交之后,输入应指向下面的PHP文档。我不确定为什么我会收到错误。
HTML文档
<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>
第30行的PHP文档错误: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>