DB_postgresql Klassenreferenz

Aufstellung aller Elemente

Öffentliche Methoden

 connect ($conf)
 disconnect ()
 query ($query)
 fetchRow ($result, $rownum)
 freeResult ($result)
 numCols ($result)
 numRows ($result)

Öffentliche Attribute

 $connection


Ausführliche Beschreibung

Definiert in Zeile 28 der Datei postgresql.class.php.


Dokumentation der Elementfunktionen

DB_postgresql::connect ( conf  ) 

Verbinden zum POSTGRES-Server.

Parameter:
Array $conf
Rückgabe:
boolean

Definiert in Zeile 39 der Datei postgresql.class.php.

Benutzt $conf und $db.

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.

Rückgabe:
unknown

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 
)

Definiert in Zeile 103 der Datei postgresql.class.php.

00104      {
00105           return pg_fetch_array( $result,$rownum,PGSQL_ASSOC );
00106      }

DB_postgresql::freeResult ( result  ) 

Definiert in Zeile 109 der Datei postgresql.class.php.

00110      {
00111           return pg_freeresult($result);
00112      }

DB_postgresql::numCols ( result  ) 

Definiert in Zeile 115 der Datei postgresql.class.php.

00116      {
00117           return pg_numfields( $result );
00118      }

DB_postgresql::numRows ( result  ) 

Definiert in Zeile 122 der Datei postgresql.class.php.

00123      {
00124           return pg_numrows($result);
00125      }

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      }


Dokumentation der Datenelemente

DB_postgresql::$connection

Definiert in Zeile 30 der Datei postgresql.class.php.


Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei:

Erzeugt am Thu May 14 00:55:49 2009 für OpenRat von  doxygen 1.5.8