April 2026
Intermediate
1009 pages
34h 15m
English
Oracle has its specialties, just like the other data types and the sequences. These can be found in the tried and tested standard guestbook example, which we have ported to the OCI8 extension.
When creating the table, we need a new sequence and the corresponding INSERT trigger. So that we don't have to bother with different language settings for the date field, we declare it as a numeric field and later write the current timestamp in Unix epoch format.
<?php if ($db = oci_connect("user", "password", "orcl")) { $sql = "CREATE TABLE guestbook ( id NUMBER(10) PRIMARY KEY, heading VARCHAR2(1000), entry VARCHAR2(5000), author VARCHAR2(50), email VARCHAR2(100), date NUMBER(20) PRIMARY KEY ); CREATE ...
Read now
Unlock full access