Class: SimpleMySQLConnection

Source Location: /CORE/system/classes/sql/SimpleMySQLConnection.php

Class SimpleMySQLConnection

Class Overview

Implementation of the DatabaseConnection to connect to a MySQL Database.

Located in /CORE/system/classes/sql/SimpleMySQLConnection.php [line 40]

DatabaseConnection
   |
   --SimpleMySQLConnection
Author(s):
  • Kevin Papst
Information Tags:
Version:  $Id: SimpleMySQLConnection.php,v 1.13 2009/02/27 23:53:05 kpapst Exp $
Copyright:  Copyright (C) Kevin Papst
License:  GNU Public License

Methods

[ Top ]
Descendants
Child Class Description
StatisticConnection This class opens a connection to the statistic database.
MySQLConnection Class used for connecting to a configurable MySQL Database.

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From DatabaseConnection

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

[ Top ]
Method Summary
SimpleMySQLConnection   SimpleMySQLConnection()   Connects to the DB by using the configured Database values.
void   close()   This closes the currently Connection.
void   connect()   Connects to a MySQL DB using the given Connection Values.
mixed   escape()   Escapes a value to be used in any SQL Statement.
void   freeResult()   Frees the given MySQL resources.
void   getError()  
void   insert()   Inserts a new DB entry and if exists returns the auto increment value.
boolean   isConnected()   Returns whether we are connected to a DB or not.
void   sql()   Executes any SQL Statement (mysql_query).

[ Top ]
Methods
Constructor SimpleMySQLConnection  [line 48]

  SimpleMySQLConnection SimpleMySQLConnection( )

Connects to the DB by using the configured Database values.



[ Top ]
close  [line 164]

  void close( )

This closes the currently Connection.

Might be unnecessary (PHP closes links automatically).



Redefinition of:
DatabaseConnection::close()
Closes the currently used Connection.

[ Top ]
connect  [line 60]

  void connect( String $host, String $db, String $user, String $password, [boolean $newConnection = false]  )

Connects to a MySQL DB using the given Connection Values.

Parameters:
String   $host:  the DB Host
String   $db:  the Database to select
String   $user:  the DB User
String   $password:  the Users Password
boolean   $newConnection:  whether a new Connection should be established


[ Top ]
escape  [line 154]

  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


Redefinition of:
DatabaseConnection::escape()
Escapes a value to be used in any SQL Statement.

[ Top ]
freeResult  [line 175]

  void freeResult( $result  )

Frees the given MySQL resources.

Parameters:
   $result: 


Redefinition of:
DatabaseConnection::freeResult()
Free the given SQL resource.

[ Top ]
getError  [line 182]

  void getError( )



Redefinition of:
DatabaseConnection::getError()
Return a DBError or null.

[ Top ]
insert  [line 139]

  void insert( $query  )

Inserts a new DB entry and if exists returns the auto increment value.

Parameters:
   $query: 


Redefinition of:
DatabaseConnection::insert()
Inserts one or more rows and returns the result.

[ Top ]
isConnected  [line 120]

  boolean isConnected( )

Returns whether we are connected to a DB or not.


API Tags:
Return:  true on successful Connection


Redefinition of:
DatabaseConnection::isConnected()
Returns whether we are connected to the Database or not.

[ Top ]
sql  [line 127]

  void sql( $query  )

Executes any SQL Statement (mysql_query).

Parameters:
   $query: 


Redefinition of:
DatabaseConnection::sql()
Returns the Result of this SQL Query.

[ Top ]