Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 class db2Resultset
00016 {
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 private $objRecord = array();
00028
00029
00030
00031
00032
00033
00034
00035 private $objResult;
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 public function __construct( $result )
00048 {
00049 $this->objResult = $result;
00050 }
00051
00052
00053
00054
00055
00056
00057
00058 public function affected_rows()
00059 {
00060 if ( $this->objResult )
00061 return db2_num_rows( $this->objResult );
00062 }
00063
00064
00065
00066
00067
00068
00069
00070 public function fetch_array()
00071 {
00072 if ( $this->objResult )
00073 {
00074 $this->objRecord = db2_fetch_assoc( $this->objResult );
00075
00076 return ( $this->objRecord != null );
00077 }
00078 }
00079
00080
00081
00082
00083
00084
00085
00086 public function fetch_object()
00087 {
00088 if ( $this->objResult )
00089 return db2_fetch_object( $this->objResult );
00090 }
00091
00092
00093
00094
00095
00096
00097
00098 public function fetch_row()
00099 {
00100 if ( $this->objResult )
00101 {
00102 $this->objRecord = db2_fetch_array( $this->objResult );
00103
00104 return ( $this->objRecord != null );
00105 }
00106 }
00107
00108
00109
00110
00111
00112
00113
00114
00115 public function field( $field )
00116 {
00117 if ( $this->objResult )
00118 {
00119 if ( get_magic_quotes_runtime() )
00120 return stripslashes( $this->objRecord[strtoupper( $field )] );
00121 else
00122 return $this->objRecord[strtoupper( $field )];
00123 }
00124 }
00125
00126
00127
00128
00129
00130
00131 public function flush()
00132 {
00133 if ( $this->objResult )
00134 {
00135 db2_free_result( $this->objResult );
00136 $this->objRecord = array();
00137 $this->objResult = null;
00138 }
00139 }
00140
00141
00142
00143
00144
00145
00146
00147 public function num_fields()
00148 {
00149 if ( $this->objResult )
00150 return db2_num_fields( $this->objResult );
00151 }
00152
00153
00154
00155
00156
00157
00158
00159 public function num_rows()
00160 {
00161 if ( $this->objResult )
00162 {
00163 while ( $row = db2_fetch_array( $this->objResult ) )
00164 return $row[0];
00165 }
00166 }
00167
00168
00169
00170
00171
00172
00173
00174 public function result()
00175 {
00176 return $this->objResult;
00177 }
00178 }
00179
00180 ?>