Teach you to use Oracle Database in PHP (ii)
Create A Table Using OCI
Below we will create an email personal information book. This time using the OCI8 API directive
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 2 code syntax is almost the same, the difference is only the function name is different; Second, in OCI8 we do not need to run the instruction to open the cursor specifically, and a cursor ID is returned automatically when the Ociparse system is called.
The above describes the teaching you to use the Oracle database in PHP (ii), including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.