CodeCharge Studio

DB<connectionname> Variable (PHP)

Applies to

Page Context

Type

object (clsDB<connectionname>)

Access

read-only

Syntax

global $DB<connectionname>
$DB<connectionname>->...

Description

This property is a global variable declared at the beginning of the page and represents each database connection used within the page. The connection object encapsulates the implementation details used to establish the connection with the database (i.e. database name, location, user login/password, etc).

The database connection variable can be used to perform custom database operations (e.g. it is used as the fourth argument of the CCDLookup function). The name of the database connection object is created by prepending the connection name (configured in the CCS environment) with the prefix "DB" (e.g. for a connection called Internet within CodeCharge Studio, the corresponding variable name for the connection object would be DBInternet).

Examples

Lookup Single Field Value in a Database,
Create Custom Session Variables,
Execute Custom SQL,
Retrieve Multiple Field Values from a Database,
Utilize MySQL Enum Field Type

See also

ds Property


On-line, printable versions and updates