Why Learn It?
 

Creating an Application Using PHP

Previous previous|next Next Page

Sheila's team is requested to create a Web application for the human resources (HR) information in the database tables. The company HR representatives would like to query departmental and employee information.

Sheila's team decides to provide this functionality by using PHP running on a Web server. The PHP application needs to access Oracle Database 10g Release 2 Express Edition to obtain the data.

You learn how to help Sheila install and configure the environment for PHP applications by performing the following tasks:

Configure the Apache Web server to enable user directories.

Install Zend Core for Oracle, which provides a PHP engine to execute PHP code.

Configure Zend Core for Oracle to enable verbose display of error messages during development of the PHP application.

You learn to Insert Graphic Here create a PHP application that:

Queries the DEPARMENTS and EMPLOYEES tables

Displays the queried database data in HTML table format

 

The PHP application comprises the following files:

hr.php, which contains the PHP application control logic
hr_cn.inc, an include file that defines database connection properties

hr_ui.inc, an include file containing user interface functions

hr_db.inc, an include file containing database access logic

Note: The PHP files can be accessed by a browser. The include (.inc) files are needed by the PHP file and are not intended to be accessed from a browser.

Note: The .php files can be accessed by a browser. The include (.inc) files are needed by the PHP file and not intended to be accessed from a browser.

If you are using Oracle JDeveloper 10g (10.1.2, or 9.0.5.2), you can download the PHP extension from Extensions Exchange on the Oracle Technology Network (OTN) to enable development of PHP applications in Oracle JDeveloper.