cubrid_bind

PECL CUBRID >= 8.3.0
cubrid_bind - Bind variables to a prepared statement as parameters
Manual
Code Examples

cubrid_bind(
     resource$req_identifier,
     int$bind_index,
     mixed$bind_value,
     [string$bind_value_type]
): bool

The cubrid_bind function is used to bind values to a corresponding named or question mark placeholder in the SQL statement that was passed to cubrid_prepare. If bind_value_type is not given, string will be the default.

Note:

If the type of data to be bound is BLOB/CLOB, CUBRID will try to map the data as a PHP stream. If the actually bind value type is not stream, CUBRID will convert it to string, and use it as the full path and file name of a file on the client filesystem.

If the type of data to be bound explicitly is ENUM, the bind_value argument should be the enum element which is in string format.

In CUBRID shard envrioment, the bind_value_type must be included in the cubrid_bind function.

The following table shows the types of substitute values.

CUBRID Bind Date Types
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
ENUM ENUM
BLOB BLOB
CLOB CLOB
NULL NULL
Not supported SET SET
MULTISET MULTISET
SEQUENCE SEQUENCE

Parameters

req_identifier

Request identifier as a result of cubrid_prepare.

bind_index

Location of binding parameters. It starts with 1.

bind_value

Actual value for binding.

bind_value_type

A type of the value to bind. (It is omitted by default. Thus, the system internally uses string by default. However, you need to specify the exact type of the value as an argument when they are NCHAR, BIT, or BLOB/CLOB).

Return Values

Returns true on success or false on failure.

Changelog

Version Description
8.3.1 Added BLOB/CLOB data types support.

Related Functions

Example of cubrid_bind

Show all examples for cubrid_bind

PHP Version:


Function cubrid_bind:

CUBRID Functions

Most used PHP functions