DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(mysql.info.gz) mysql_stmt_bind_param

Info Catalog (mysql.info.gz) mysql_stmt_attr_set (mysql.info.gz) C API Prepared statement functions (mysql.info.gz) mysql_stmt_bind_result
 
 22.2.7.4 `mysql_stmt_bind_param()'
 ..................................
 
 `my_bool mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND *bind)'
 
 Description
 ...........
 
 `mysql_stmt_bind_param()' is used to bind data for the parameter markers
 in the SQL statement that was passed to `mysql_stmt_prepare()'. It uses
 `MYSQL_BIND' structures to supply the data. `bind' is the address of an
 array of `MYSQL_BIND' structures.  The client library expects the array
 to contain an element for each `?' parameter marker that is present in
 the query.
 
 Suppose that you prepare the following statement:
 
      INSERT INTO mytbl VALUES(?,?,?)
 
 When you bind the parameters, the array of `MYSQL_BIND' structures must
 contain three elements, and can be declared like this:
 
      MYSQL_BIND bind[3];
 
 The members of each `MYSQL_BIND' element that should be set are
 described in  C API Prepared statement datatypes.
 
 This function was added in MySQL 4.1.2.
 
 Return Values
 .............
 
 Zero if the bind was successful. Non-zero if an error occurred.
 
 Errors
 ......
 
 `CR_INVALID_BUFFER_USE'
      Indicates if the bind is to supply the long data in chunks and if
      the buffer type is non string or binary.
 
 `CR_UNSUPPORTED_PARAM_TYPE'
      The conversion is not supported. Possibly the `buffer_type' value
      is illegal or is not one of the supported types.
 
 `CR_OUT_OF_MEMORY'
      Out of memory.
 
 `CR_UNKNOWN_ERROR'
      An unknown error occurred.
 
 Example
 .......
 
 For the usage of `mysql_stmt_bind_param()', refer to the Example from
  `mysql_stmt_execute()' mysql_stmt_execute.
 
Info Catalog (mysql.info.gz) mysql_stmt_attr_set (mysql.info.gz) C API Prepared statement functions (mysql.info.gz) mysql_stmt_bind_result
automatically generated byinfo2html