Cubrid Functions
PHP Manual

cubrid_bind

(PHP 4, PHP 5)

cubrid_bindIs used to bind values

Description

int cubrid_bind ( int $req_handle , int $bind_index , string $bind_value [, string $bind_value_type ] )

The cubrid_bind() function is used to bind values in a cubrid_prepare() variable, a various types in PHP and corresponding types in SQL.

Parameters

req_handle

Request handle as a result of cubrid_prepare.()

bind_index

Index for binding.

bind_value

Actual value for binding.

bind_index

A type of the value to bind. (It is omitted by default. Thus, system internally converts and matches the corresponding types if it is omitted. However, you need to specify the exact type of the value as an argument when they are either NCHAR or BIT).

Return Values

TRUE, when process is successful.

FALSE, when process is unsuccessful.

Examples

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$sqlCUBRID_INCLUDE_OID ); 
 
$i 0;
 while ( 
$i ) { 
 
$res cubrid_bind$req1"1""NUMBER"); 
 
$res cubrid_bind$req2"2"); 
 
$res cubrid_bind$req3"04:22:34 PM 08/07/2007"); 
 
$res cubrid_execute$req );  
 
$i $i 1
}} 
?>

See Also


Cubrid Functions
PHP Manual