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