You must call
every statement that successfully produces a result set
only if you want to buffer the complete result set by the
client, so that the subsequent
mysql_stmt_fetch() call returns buffered
It is unnecessary to call
mysql_stmt_store_result() for other
statements, but if you do, it does not harm or cause any
notable performance problem. You can detect whether the
statement produced a result set by checking if
NULL. For more information, refer to
Section 220.127.116.11, “
Note: MySQL doesn't by
MYSQL_FIELD->max_length for all columns
calculating this would slow down
mysql_stmt_store_result() considerably and
most applications doesn't need
If you want
max_length to be updated, you
STMT_ATTR_UPDATE_MAX_LENGTH, &flag) to enable
this. See Section 18.104.22.168, “
Zero if the results are buffered successfully. Non-zero if an
Commands were executed in an improper order.
Out of memory.
The MySQL server has gone away.
The connection to the server was lost during the query.
An unknown error occurred.