Class: DatabaseConnection

Source Location: /CORE/system/api/sql/DatabaseConnection.php

Class DatabaseConnection

Class Overview

Interface for Database Connections.

The Implementation has to overwrite all mentioned methods in a proper way.

Located in /CORE/system/api/sql/DatabaseConnection.php [line 37]



		
				Author(s):
		
  • Kevin Papst
Information Tags:
Version:  $Id: DatabaseConnection.php,v 1.6 2008/12/30 21:28:45 kpapst Exp $
Copyright:  Copyright (C) Kevin Papst
License:  GNU Public License

Methods

[ Top ]
Descendants
Child Class Description
AdoDBConnection Class used for connecting to a Database by using the AdoDB Framework.
SimpleMySQLConnection Implementation of the DatabaseConnection to connect to a MySQL Database.

[ Top ]
Method Summary
mixed   close()   Closes the currently used Connection.
mixed   escape()   Escapes a value to be used in any SQL Statement.
mixed   freeResult()   Free the given SQL resource.
DBError   getError()   Return a DBError or null.
mixed   insert()   Inserts one or more rows and returns the result.
boolean   isConnected()   Returns whether we are connected to the Database or not.
Result   sql()   Returns the Result of this SQL Query.

[ Top ]
Methods
close  [line 77]

  mixed close( )

Closes the currently used Connection.


API Tags:
Return:  the result of this close attempt


Redefined in descendants as:

[ Top ]
escape  [line 69]

  mixed escape( mixed $value  )

Escapes a value to be used in any SQL Statement.

Parameters:
mixed   $value:  value the value to be escaped

API Tags:
Return:  the escaped value


Redefined in descendants as:

[ Top ]
freeResult  [line 85]

  mixed freeResult( $result  )

Free the given SQL resource.

Parameters:
   $result: 

API Tags:
Return:  the result


Redefined in descendants as:

[ Top ]
getError  [line 93]

  DBError getError( )

Return a DBError or null.


API Tags:
Return:  or null


Redefined in descendants as:

[ Top ]
insert  [line 60]

  mixed insert( $statement  )

Inserts one or more rows and returns the result.

Parameters:
   $statement: 

API Tags:
Return:  the result of this insert


Redefined in descendants as:

[ Top ]
isConnected  [line 44]

  boolean isConnected( )

Returns whether we are connected to the Database or not.


API Tags:
Return:  the connection state


Redefined in descendants as:

[ Top ]
sql  [line 52]

  Result sql( $statement  )

Returns the Result of this SQL Query.

Parameters:
   $statement: 

API Tags:
Return:  the result of this Query


Redefined in descendants as:

[ Top ]