Oracle_DbDriver.object
上传用户:xiao730204
上传日期:2007-01-04
资源大小:141k
文件大小:2k
- <?php
- class Oracle_DbDriver extends BaseObject {
- var $sql_statement;
- var $db_connection_handle;
- var $db_result;
- var $db_result_return;
- var $debug;
- Function Oracle_DbDriver() {
- $this->BaseObject( 'Oracle_DbDriver' );
- $this->sql_statement = '';
- $this->db_connection_handle = '';
- $this->db_result = '';
- $this->db_result_return = -1;
- $this->debug = new Debug();
- $this->debug->prefix = 'Oracle_Db::DbDriver';
- $this->debug->Off();
- }
- Function Exec() {
- $this->debug->Message(
- 'Execing sql stmt : ' . "n" .
- $this->sql_statement . "n"
- );
- $this->db_result =
- @OCIParse(
- $this->db_connection_handle,
- $this->sql_statement
- );
- $this->db_result_return = @OCIExecute( $this->db_result );
- if ( $this->db_result_return == false ) {
- $error_string = @ocierrror;
- $this->debug->Message( $error_string );
- return false;
- } else {
- $this->db_result_return = true;
- return true;
- }
- }
- Function GetInsertId() {
- /* NOT IMPLEMENTED */
- return false;
- }
- Function FetchRow() {
- /* If the sql hasn't been ran dammit run it */
- if ( $this->db_result_return != true ) { $this->Exec(); }
- if ( $this->db_result_return == true ) {
- /* Return a row */
- $t_arr = Array();
- $ret_val = @OCIFetchInto( $this->db_result, $t_arr );
- if ( $ret_val == 0 ) {
- return false;
- } else {
- return $t_arr;
- }
- } else {
- /* Whooo bad high... out of rows and or out of command */
- return false;
- }
- }
- Function FetchCell( $xx, $yy ) {
- return Array( false, 'Not implemented under the oracle driver' );
- }
- }
- ?>