my_bool mysql_stmt_bind_result(MYSQL_STMT *stmt,
mysql_stmt_bind_result() is used to
associate (bind) columns in the result set to data buffers and
length buffers. When
called to fetch data, the MySQL client/server protocol places
the data for the bound columns into the specified buffers.
All columns must be bound to buffers prior to calling
is the address of an array of
structures. The client library expects the array to contain an
element for each column of the result set. Otherwise,
mysql_stmt_fetch() simply ignores the data
fetch. Also, the buffers should be large enough to hold the
data values, because the protocol doesn't return data values
A column can be bound or rebound at any time, even after a
result set has been partially retrieved. The new binding takes
effect the next time
called. Suppose that an application binds the columns in a
result set and calls
The client/server protocol returns data in the bound buffers.
Then suppose the application binds the columns to a different
set of buffers. The protocol does not place data into the
newly bound buffers until the next call to
To bind a column, an application calls
mysql_stmt_bind_result() and passes the
type, address, and the address of the length buffer. The
members of each
MYSQL_BIND element that
should be set are described in
Section 24.2.5, « Types de données de l'API C ».
Zero if the bind was successful. Non-zero if an error occurred.
The conversion is not supported. Possibly the
buffer_type value is illegal or is not
one of the supported types.
Out of memory.
An unknown error occurred.
For the usage of
refer to the Example from Section 126.96.36.199, «
This is a translation of the MySQL Reference Manual that can be found at dev.mysql.com. The original Reference Manual is in English, and this translation is not necessarily as up to date as the English version.