Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy


int mysql_stmt_store_result(MYSQL_STMT *stmt)


You must call mysql_stmt_store_result() for every statement that successfully produces a result set (SELECT, SHOW, DESCRIBE, EXPLAIN), and only if you want to buffer the complete result set by the client, so that the subsequent mysql_stmt_fetch() call returns buffered data.

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 mysql_stmt_result_metadata() returns NULL. For more information, refer to Section, “mysql_stmt_result_metadata().

Note: MySQL doesn't by default calculate MYSQL_FIELD->max_length for all columns in mysql_stmt_store_result() because calculating this would slow down mysql_stmt_store_result() considerably and most applications doesn't need max_length. If you want max_length to be updated, you can call mysql_stmt_attr_set(MYSQL_STMT, STMT_ATTR_UPDATE_MAX_LENGTH, &flag) to enable this. See Section, “mysql_stmt_attr_set().

Return Values

Zero if the results are buffered successfully. Non-zero if an error occurred.



    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.

  Published under the terms of the GNU General Public License Design by Interspire