Oracle and PHP

Referat
7/10 (1 vot)
Domeniu: Engleză
Conține 1 fișier: doc
Pagini : 11 în total
Cuvinte : 2640
Mărime: 206.14KB (arhivat)
Publicat de: Flora Luca
Puncte necesare: 5

Cuprins

  1. Contents
  2. Introduction to PHP 2
  3. PHP ORACLE EXTENSIONS 2
  4. Oracle Extension 3
  5. OCI8 Extension 3
  6. PDO Extension 4
  7. CONNECTING TO ORACLE USING OCI8 5
  8. Oracle Connection Types 5
  9. Standard Connections 5
  10. Multiple Unique Connections 5
  11. Persistent Connections 5
  12. Oracle Database Name Connection Identifiers 7
  13. Easy Connect String 7
  14. Database Connect Descriptor String 8
  15. Database Connect Name 8
  16. Closing Oracle Connections 9
  17. Close Statement Resources Before Closing Connections 9
  18. Conclusion 11
  19. BIBLIOGRAPHY 11

Extras din referat

Introduction to PHP

PHP has one of those recursive names, PHP Hypertext Preprocessor. It was originally designed around web programming, but has since evolved to be a full-fledged scripting language like Perl. Far and away the strength of PHP is in its community, and how it has evolved. Rather than being designed at the outset to be everyone's ideal language and framework, PHP has evolved a huge base of developers, and libraries of functions that people needed in the real world.

PHP is a hugely popular, interpreted scripting language commonly used for web applications. PHP is open source and free, and has a BSD-style license, making it corporation-friendly. PHP is perfect for rapidly developing applications both big and small, and is great for creating Web 2.0 applications. It powers over twenty million web sites on the Internet and has a huge user community behind it. It runs on many platforms.

The language is dynamically typed and easy to use. PHP comes with many extensions offering all kinds of functionality such as database access. PHP 5 introduced strong object orientated capabilities.

PHP ORACLE EXTENSIONS

PHP has several extensions that let applications use Oracle. There are also database abstraction libraries written in PHP which are popular. Although this book concentrates on the OCI8 extension for PHP, it is worth knowing the alternatives.

Database access in each extension and abstraction library is fundamentally similar. The differences are in their support for advanced features and the programming methodology promoted. If you want to make full use of Oracle's features and want high performance then use OCI8, which is PHP’s main Oracle extension. If you want database independence, consider using the PHP Data Object (PDO) extension or the ADOdb abstraction library.

The PHP world can move at a fast pace, so examine your requirements and the latest information available before starting a project.

The PHP Oracle extensions are written in C and linked into the PHP binary. The extensions are:

- Oracle

- OCI8

- PDO

You can also use the ODBC extension.

Oracle Extension

The extension called “Oracle” was included in PHP 3, 4 and 5.0. It had limited functionality, is no longer in PHP, and is not maintained. The extension accessed the database using Oracle’s obsolete “OCI7” C language API. New development using this extension is not recommended.

OCI8 Extension

OCI8 is the recommended extension to use. It is included in PHP 3, 4, and 5. It is also in PHP 6, which is in the early stage of development. It is open source and maintained by the PHP community. Oracle is a member of the community looking after OCI8.

There have been major and minor changes to the OCI8 extension in various versions of PHP. It is recommended to upgrade the default OCI8 code in PHP 4 – PHP 5.2 to the latest version of the extension. An example script that finds city names from the locations table using OCI8:

Script 1: intro.php

<?php

$c = oci_connect('hr', 'hrpwd', 'localhost/XE');

$s = oci_parse($c, 'select city from locations');

oci_execute($s);

while ($res = oci_fetch_array($s, OCI_ASSOC)) {

echo $res['CITY'] . "<br>";

}

?>

When invoked in a web browser, it connects as the demonstration user hr of the Oracle Database XE database running on the local machine. The query is executed and a web page of results is displayed in the browser:

Figure 1: PHP Output in a web browser.

In PHP 5, some extension function names were standardized. PHP 4 functions like OCILogin() became oci_connect(), OCIParse() became oci_parse() and so on. The old names still exist as aliases, so PHP 4 scripts do not need to be changed. A table showing old and new names appears in Appendix C. The name “OCI8” is also the name for Oracle’s Call Interface API used by C programs such as the PHP OCI8 extension. All unqualified references to OCI8 in this book refer to the PHP extension.

PDO Extension

PHP Data Objects (PDO) is a data abstraction extension that provides PHP functions for accessing databases using a common core of database independent methods. Each database has its own driver, which may also support vendor specific functionality. PDO_OCI provides the Oracle functionality for PDO. The PDO extension and PDO_OCI driver are open source and included in PHP 5.1 onwards.

Preview document

Oracle and PHP - Pagina 1
Oracle and PHP - Pagina 2
Oracle and PHP - Pagina 3
Oracle and PHP - Pagina 4
Oracle and PHP - Pagina 5
Oracle and PHP - Pagina 6
Oracle and PHP - Pagina 7
Oracle and PHP - Pagina 8
Oracle and PHP - Pagina 9
Oracle and PHP - Pagina 10
Oracle and PHP - Pagina 11

Conținut arhivă zip

  • Oracle and PHP.doc

Alții au mai descărcat și

Risk Management - A Science Or An Art

Strategies for identifying and measuring risk can help treasury personnel develop a sound diversification policy Before a risk profile can be...

The Evolution of Computer Science

The Evolution Of Computer Science The birth of computers and information technology goes back many centuries. The development of mathematics led...

11th of September 2001

The day of September 11th 2001 will remain as a dark day in history. All people know about this day and what happened at this date. On this day,...

The Tempest

Type of Work - Play Genre - Romance Language - Elizabethan English Time and place written - 16101611; England Tone - Dreamy,...

Test de engleză 3

Part Three: Gapped Text You are going to read a magazine article about a trip to Australia. Seven paragraphs have been removed from the article...

Prezentare a Mediului de Afaceri Argentinian

INTRODUCTION Essential facts about Argentina Geert Hofstede analysis over Argentina and the Latin American countries BUSINESS ETIQUETTE...

Te-ar putea interesa și

Consumatorul digital și analiza comportamentului lui pe platformele CRM

Capitolul 1. Platformele CRM. Necesitate sau moft? În acest capitol vom aprofunda anumite informații despre gestiunea relațiilor cu clienții, vom...

Sistem informatic pentru implementarea conceptului de open mutual care - asistență socială bazată pe reciprocitate

Introduction The concept of helping people appeared a long time ago and was defined by human nature as“the situation when someone need to be...

Interacțiunea dintre PHP și alte limbaje de programare

Abstract The present work sheet is to be a consistent overflow of the most important interactions between PHP and other programming languages. The...

Introducere în PHP

Introducere in php Un fisier php poate contine text, etichete html si scripturi. Scripturile in fisierele php sunt executate de server. What is...

Ai nevoie de altceva?