Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.4.3 |  CUBRID 9.0.0 | 

PDO Programming

Data Source Name (DSN)

The PDO_CUBRID data source name (DSN) consists of the following elements:

Element

Description

DSN prefix

The DSN prefix is cubrid.

host

The hostname on which the database server resides

port

The port number where the database server is listening

dbname

The name of the database

Example

"cubrid:host=127.0.0.1;port=33000;dbname=demodb"

Predefined Constants

The constants defined by CUBRID PDO driver are available only when the extension has been either compiled into PHP or dynamically loaded at runtime. In addition, these driver-specific constants should only be used if you are using PDO driver. Using driver-specific attributes with another driver may result in unexpected behaviour.

The PDO::getAttribute() function may be used to obtain the PDO_ATTR_DRIVER_NAME attribute value to check the driver if your code can run

The constants below can be used with the PDO::cubrid_schema function to get schema information.

Constant

Type

Description

PDO::CUBRID_SCH_TABLE

integer

Gets name and type of table in CUBRID.

PDO::CUBRID_SCH_VIEW

integer

Gets name and type of view in CUBRID.

PDO::CUBRID_SCH_QUERY_SPEC

integer

Get the query definition of view.

PDO::CUBRID_SCH_ATTRIBUTE

integer

Gets the attributes of table column.

PDO::CUBRID_SCH_TABLE_ATTRIBUTE

integer

Gets the attributes of table.

PDO::CUBRID_SCH_TABLE_METHOD

integer

Gets the instance method. The instance method is a method called by a class instance. It is used more often than the class method because most operations are executed in the instance.

PDO::CUBRID_SCH_METHOD_FILE

integer

Gets the information of the file where the method of the table is defined.

PDO::CUBRID_SCH_SUPER_TABLE

integer

Gets the name and type of table which table inherits attributes from.

PDO::CUBRID_SCH_SUB_TABLE

integer

Gets the name and type of table which inherits attributes from this table.

PDO::CUBRID_SCH_CONSTRAINT

integer

Gets the table constraints.

PDO::CUBRID_SCH_TRIGGER

integer

Gets the table triggers.

PDO::CUBRID_SCH_TABLE_PRIVILEGE

integer

Gets the privilege information of table.

PDO::CUBRID_SCH_COL_PRIVILEGE

integer

Gets the privilege information of column.

PDO::CUBRID_SCH_DIRECT_SUPER_TABLE

integer

Gets the direct super table of table.

PDO::CUBRID_SCH_DIRECT_PRIMARY_KEY

integer

Gets the table primary key.

PDO::CUBRID_SCH_IMPORTED_KEYS

integer

Gets imported keys of table.

PDO::CUBRID_SCH_EXPORTED_KEYS

integer

Gets exported keys of table.

PDO::CUBRID_SCH_CROSS_REFERENCE

integer

Gets reference relationship of two tables.

Note To get the latest information about PDO driver, click http://www.cubrid.org/wiki_apis/entry/cubrid-pdo-driver.