This is a discussion on DB Connection in PHP within the PHP Programming forums, part of the Web Development category; oci_new_connect() establishes a new connection to an Oracle server and logs on. Unlike oci_connect() and oci_pconnect(), oci_new_connect() does not cache ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| oci_new_connect() establishes a new connection to an Oracle server and logs on. Unlike oci_connect() and oci_pconnect(), oci_new_connect() does not cache connections and will always return a brand-new freshly opened connection handle. This is useful if your application needs transactional isolation between two sets of queries.
__________________ With, J. Jeyaseelan Everything Possible |
| Sponsored Links |
| |||
| oci_pconnect() creates a persistent connection to an Oracle server and logs on. Persistent connections are cached and re-used between requests, resulting in reduced overhead on each page load; a typical PHP application will have a single persistent connection open against an Oracle server per Apache child process
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| In PHP versions before 5.0.0 you must use ociplogon() instead. This name still can be used, it was left as alias of oci_pconnect() for downwards compatability. This, however, is deprecated and not recommended.
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| oci_commit() commits all outstanding statements for the active transaction on the Oracle connection connection. PHP Code:
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| oci_define_by_name() defines PHP variables for fetches of SQL-Columns. Take into consideration that Oracle uses ALL-UPPERCASE column names, whereby in your select you can also use lowercase. If you need to define an abstract datatype (LOB/ROWID/BFILE) you must allocate it first using oci_new_descriptor().
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| oci_define_by_name() example PHP Code:
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| oci_new_descriptor() allocates resources to hold descriptor or LOB locator. Valid values for type are: OCI_D_FILE, OCI_D_LOB and OCI_D_ROWID.
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| oci_bind_by_name() binds the PHP variable variable to the Oracle placeholder ph_name. Whether it will be used for input or output will be determined at run-time and the necessary storage space will be allocated. If you need to bind an abstract datatype (LOB/ROWID/BFILE) you need to allocate it first using the oci_new_descriptor() function. The length is not used for abstract datatypes and should be set to -1. The type parameter tells Oracle which descriptor is used. Possible values are:
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| oci_bind_by_name() example PHP Code:
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| Do not use magic_quotes_gpc or addslashes() and oci_bind_by_name() simultaneously as no quoting is needed and any magically applied quotes will be written into your database as oci_bind_by_name() is not able to distinguish magically added quotings from those added intentionally.
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| oci_new_cursor() allocates a new statement handle on the specified connection. Using REF CURSOR in an Oracle's stored procedure PHP Code:
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| Here Using REF CURSOR in an Oracle's select statement PHP Code:
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| oci_server_version() returns a string with version information of the Oracle server, which uses connection connection or returns FALSE on error. Example PHP Code:
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| oci_statement_type() returns the query type of statement statement as one of the following values:
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| oci_statement_type() example PHP Code:
__________________ With, J. Jeyaseelan Everything Possible |