PHP is a popular scripting language that can be embedded in HTML, which makes it particularly useful for Web development. Zend Core for Oracle enables application development using PHP with Oracle Database.
This chapter has the following topics:
Zend Core for Oracle, developed in partnership with Zend Technologies, provides a stable, high performance, easy-to-install, and supported PHP development and production environment that is fully integrated with Oracle Database.
This document is a tutorial that shows you how to use Zend Core for Oracle to connect to Oracle Database, and demonstrates how to use PHP to access and modify data.
You can also use other non-Zend Core PHP installations for PHP development with Oracle.
The application manages departmental and employee data stored in the
EMPLOYEES tables in the HR schema provided with Oracle Database. See Oracle Database Sample Schemas for information about this schema.
The complete sample application:
Establishes a connection to the database using the PHP OCI8 extension
Queries the database for departmental and employee data
Displays and navigates through the data
Shows how to insert, update, and delete employee records
Handles data exceptions
Uploads and displays employee photographs
Figure 1-1 shows the relationship among the files developed for this application.
anyco.phpThis file contains the main logic for the AnyCo application. It contains control logic that determines which page is displayed. It manages session data for navigation. It calls functions in the include files
anyco_ui.incThis file contains the functions used to present data and forms in an HTML page.
anyco_cn.incThis file contains definitions for database connection information, the database user name, password, and database connection identifier.
anyco_db.incThis file contains the database logic to create database connections, execute queries, and execute data manipulation statements.
anyco_im.phpThis file contains logic to retrieve an image from a database column and send it to a Web browser for display as a JPEG image.
style.cssThis file contains Cascading Style Sheet (CSS) definitions for various HTML tags generated by the application. It manages the look and feel of the application.
Files with the suffix
.inc are PHP code files included in other PHP files.
Files with the suffix
.php can be loaded in a Web browser.
You can create and edit the PHP application source files in a text editor or any tool that supports PHP development.
The code for each chapter builds on the files completed in the previous chapter.
The following Oracle Technology Network Web sites provide additional information you may find useful.
PHP Developer Center at
Zend Core for Oracle Developer Center at
Oracle Database Documentation Library at
Oracle SQL Developer center at