(PECL CUBRID >= 8.3.0)
cubrid_bind — Is used to bind values
The cubrid_bind() function is used to bind values in a cubrid_prepare() variable, a various types in PHP and corresponding types in SQL. If bind_value_type is not given, string will be the default.
Note: Collection type (set, multiset or sequence) value can't be bind now.
Request identifier as a result of cubrid_prepare.()
Index for binding.
Actual value for binding.
A type of the value to bind. (It is omitted by default. Thus, system internally use string by default. However, you need to specify the exact type of the value as an argument when they are either NCHAR or BIT).
TRUE, when process is successful.
FALSE, when process is unsuccessful.
Example #1 cubrid_bind() example
<?php
$con = cubrid_connect ("dbsvr.cubrid.com", 12345, "demodb");
if ($con) {
$sql = "insert into tbl values ( ?,?,?)";
$req = cubrid_prepare( $con, $sql, CUBRID_INCLUDE_OID );
$i = 0;
while ( $i < 2 ) {
$res = cubrid_bind( $req, 1, "1", "NUMBER");
$res = cubrid_bind( $req, 2, "2");
$res = cubrid_bind( $req, 3, "04:22:34 PM 08/07/2007");
$res = cubrid_execute( $req );
$i = $i + 1;
}}
?>