#native_company# #native_desc#
#native_cta#

Using the ADOdb library with Oracle and PHP Page 2

By Rajeev Ranjan Rakesh
on October 23, 2008

The code shown on the previous page is used to display the first two columns of the table. Once the sql statement is executed, the record set contains the result of the select statement as an array. Using a while loop we are able to traverse through each record and display the first two columns of the table. Once the display part is done, the cursor moves to the next record using the MoveNext() function. Similarly, we can perform any other operation on the record set.

$recordSet->Close(); # optional
$conn->Close(); # optional

Once we finish all operations on the record set, we can close it (though this is optional). Similarly we can close the connection to database (this is also optional).
This completes the explanation of the sample code that is used to connect to the Oracle database and perform operations on it using PHP’s ADOdb.
Note: All functions in ADOdb should be easy for Microsoft programmers to use because many of the conventions are similar to Microsoft’s own ADO.
Conclusion
In this document we have covered the connection establishment from the PHP script to the Oracle database using an OCI8 extension and an ADOdb abstract library, as well as illustrated a simple operation on the Oracle database. This article is not enough to start developing a full-fledged Open Source web-based application, but it does provide a valuable introduction to Open Source web programming.
References