Ryzom Account Management System
Public Member Functions | Private Attributes
DBLayer Class Reference

Handles the database connections. More...

List of all members.

Public Member Functions

 __construct ($db)
 The constructor.
 executeWithoutParams ($query)
 execute a query that doesn't have any parameters
 execute ($query, $params)
 execute a query that has parameters
 executeReturnId ($query, $params)
 execute a query (an insertion query) that has parameters and return the id of it's insertion

Private Attributes

 $PDO
 The PDO object, instantiated by the constructor.

Detailed Description

Handles the database connections.

It uses PDO to connect to the different databases. It will use the argument of the constructor to setup a connection to the database with the matching entry in the $cfg global variable.

Author:
Daan Janssens, mentored by Matthew Lagoe

Constructor & Destructor Documentation

The constructor.

Instantiates the PDO object attribute by connecting to the arguments matching database(the db info is stored in the $cfg global var)

Parameters:
String,thename of the databases entry in the $cfg global var.

Member Function Documentation

DBLayer::execute ( query,
params 
)

execute a query that has parameters

Parameters:
$querythe mysql query
$paramsthe parameters that are being used by the query
Returns:
returns a PDOStatement object
DBLayer::executeReturnId ( query,
params 
)

execute a query (an insertion query) that has parameters and return the id of it's insertion

Parameters:
$querythe mysql query
$paramsthe parameters that are being used by the query
Returns:
returns the id of the last inserted element.

execute a query that doesn't have any parameters

Parameters:
$querythe mysql query
Returns:
returns a PDOStatement object

The documentation for this class was generated from the following file:
 All Classes Functions Variables