Öffentliche Methoden | |
| connect ($conf) | |
| disconnect () | |
| query ($query) | |
| fetchRow ($result, $rownum) | |
| freeResult ($result) | |
| numCols ($result) | |
| numRows ($result) | |
Öffentliche Attribute | |
| $connection | |
Definiert in Zeile 28 der Datei postgresql.class.php.
| DB_postgresql::connect | ( | $ | conf | ) |
Verbinden zum POSTGRES-Server.
| Array | $conf |
Definiert in Zeile 39 der Datei postgresql.class.php.
00040 { 00041 $host = $conf['host']; 00042 $user = $conf['user']; 00043 $pw = $conf['password']; 00044 $db = $conf['database']; 00045 00046 if ( isset($conf['port']) ) 00047 $host .= ':'.$conf['port']; 00048 00049 if ( $conf['persistent'] ) 00050 $connect_function = 'pg_pconnect'; 00051 else 00052 $connect_function = 'pg_connect'; 00053 00054 if ( $pw != '' ) 00055 $this->connection = @$connect_function( "host=$host dbname=$db user=$user password=$pw" ); 00056 elseif ( $user != '' ) 00057 $this->connection = @$connect_function( "host=$host dbname=$db user=$user" ); 00058 elseif ( $host != '' ) 00059 $this->connection = @$connect_function( "host=$host dbname=$db" ); 00060 else 00061 $this->connection = @$connect_function( "dbname=$db"); 00062 00063 if ( ! is_resource($this->connection) ) 00064 { 00065 $this->error = 'could not connect to database on host '.$host; 00066 return false; 00067 } 00068 00069 return true; 00070 }
| DB_postgresql::disconnect | ( | ) |
Verbindung schließen.
Definiert in Zeile 79 der Datei postgresql.class.php.
00080 { 00081 $ret = pg_close( $this->connection ); 00082 $this->connection = null; 00083 return $ret; 00084 }
| DB_postgresql::fetchRow | ( | $ | result, | |
| $ | rownum | |||
| ) |
| DB_postgresql::freeResult | ( | $ | result | ) |
| DB_postgresql::numCols | ( | $ | result | ) |
| DB_postgresql::numRows | ( | $ | result | ) |
| DB_postgresql::query | ( | $ | query | ) |
Definiert in Zeile 88 der Datei postgresql.class.php.
00089 { 00090 $result = @pg_exec( $this->connection,$query ); 00091 00092 if ( ! $result ) 00093 { 00094 if ( empty($this->error) ) 00095 $this->error = 'PostgreSQL says: '.@pg_errormessage(); 00096 return FALSE; 00097 } 00098 00099 return $result;; 00100 }
| DB_postgresql::$connection |
Definiert in Zeile 30 der Datei postgresql.class.php.
1.5.8