cubrid_bind

Description

The cubrid_bind function substitutes a value for a variable of the cubrid_prepare() with parameters, a various types in PHP and corresponding types in SQL. If bind_value_type is not given, string will be the default. The following table shows the types of substitute values:

Support

Bind type

Corresponding SQL type

Supported

STRING

CHAR, VARCHAR

NCHAR

NCHAR, NVARCHAR

BIT

BIT, VARBIT

NUMERIC or NUMBER

SHORT, INT, NUMERIC

FLOAT

FLOAT

DOUBLE

DOUBLE

TIME

TIME

DATE

DATE

TIMESTAMP

TIMESTAMP

OBJECT

OBJECT

BLOB

BLOB

CLOB

CLOB

NULL

NULL

Not supported

SET

SET

MULTISET

MULTISET

SEQUENCE

SEQUENCE

Syntax

bind_param : Parameter identifier. For a prepared statement using named placeholders, this will be a parameter name of the form :name (Note that the name can only contain digit, alphabet, and underscore, and it cannot begin with digit. The name length cannot be longer than 32). For a prepared statement using question mark placeholders, this will be the 1-indexed position of the parameter.

bind_ value : Actual value to be bound

bind_value_type : Type of the value to be bound. It can be omitted by default. If it is omitted, the type is automatically cast to an appropriate one. However, NCHAR, BLOB/CLOB and BIT types must be passed as arguments.

Note If data is bound to BLOB/CLOB, CUBRID maps the data into PHP stream, which is a unified approach to handle files and sockets in PHP extension. If the actual value to be bound is not stream, CUBRID returns it as string; this string includes the BLOB/CLOB type meta data (Locator) which is a file path and name recorded in an external storage.