1/18
Contents
Title and Copyright Information
Preface
Audience
Documentation Accessibility
Related Documents
Conventions
1
Introducing PHP with Oracle Database
Purpose
Overview of the Sample Application
Resources
2
Getting Started
What You Need
Installing Oracle Database
Unlocking the HR User
Database Resident Connection Pooling
Starting the DRCP Pool
Installing Apache HTTP Server
Installing Apache on Windows XP
Installing Apache on Linux
Testing the Apache Installation
Installing PHP
Installing PHP on Windows
Installing PHP on Linux
Post PHP Installation Tasks on Windows and Linux
Testing the PHP Installation
Checking PHP Configuration with phpinfo()
Testing PHP Connections to Oracle
Installing the NetBeans 7.0 IDE
Installing NetBeans IDE on Windows
Installing NetBeans IDE on Linux
Configuring NetBeans on Linux and Windows
Using NetBeans
3
Building a Database Access Class
Connection Constants
Creating the Db class
General Example of Running SQL in PHP OCI8
Running SQL with the Db Class
Testing the Db Class
4
Building the AnyCo Application
A Cascading Style Sheet
An Application Class for Sessions
Providing a Stateful Web Experience with PHP Sessions
Adding a Page Class
The Application Login Page
5
Paging Through Employee Data
Creating the Employee Listing
Running the Employee List
6
Showing Equipment Records by Using a REF CURSOR
Introduction to PL/SQL Packages and Package Bodies
Introduction to PL/SQL Stored Procedures
Introduction to REF CURSORs
The Equipment Table
Calling the REF CURSOR in PHP
7
Error handling
Database Errors
Displaying a Custom Error Message
8
Query Performance and Prefetching
Prefetching Overview
The Employee Report Page
Running the Equipment Report
REF CURSOR Prefetching
9
Inserting Data
Building the Insert Form
Running the Single Insert Form
CSRF example with ac_add_one.php
10
Inserting Multiple Data Values
Creating the Multiple Insert Form
Running the Multiple Insert Form
11
Using JSON and generating a JPEG image
Creating a Simple Web Service Returning JSON
Creating a JPEG image
12
Uploading and Displaying BLOBs
Creating a Table to Store the Logo
Uploading Images in PHP OCI8
Fetching the Logo and Creating an Image
Displaying the Logo
13
Monitoring Database Usage of the Application
Overview of Metadata
Viewing Metadata
More Uses of Metadata
Metadata and Persistent Connections
14
Building Global Applications
Establishing the Environment Between Oracle and PHP
Manipulating Strings
Determining the Locale of the User
Developing Locale Awareness
Encoding HTML Pages
Specifying the Page Encoding for HTML Pages
Specifying the Page Encoding in PHP
Organizing the Content of HTML Pages for Translation
Strings in PHP
Static Files
Data from the Database
Presenting Data Using Conventions Expected by the User
Oracle Date Formats
Oracle Number Formats
Oracle Linguistic Sorts
Oracle Error Messages
Index
Scripting on this page enhances content navigation, but does not change the content in any way.