Create A Table Using OCI
Next we will create an email personal information book. This time OCI8 API command is used
Related PHP code:
PutEnv("ORACLE_SID=ORASID");
$connection = OCILogon ("username", " password");
if ($connection == false){
echo OCIError($connection)."
";
exit;
}
$query = "create table email_info " .
"(fullname varchar(255), email_address varchar(255))";
$cursor = OCIParse ($connection, $query);
if ($cursor == false){
echo OCIError($cursor)."
";
exit;
}
$result = OCIExecute ($cursor);
if ( $result == false){
echo OCIError($cursor)."
";
exit;
}
OCICommit ($connection);
OCILogoff ($ connection);
?>
We can see that the syntax of these two pieces of code is almost the same, the only difference is the function name; Secondly, in OCI8 we do not need to run it specifically When opening the cursor command, the system automatically returns a cursor ID when calling OCIParse.