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
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

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

  




 

 

25.2.3.45. mysql_next_result()

int mysql_next_result(MYSQL *mysql)

Description

If more query results exist, mysql_next_result() reads the next query results and returns the status back to application.

You must call mysql_free_result() for the preceding query if it returned a result set.

After calling mysql_next_result() the state of the connection is as if you had called mysql_real_query() or mysql_query() for the next query. This means that you can call mysql_store_result(), mysql_warning_count(), mysql_affected_rows(), and so forth.

If mysql_next_result() returns an error, no other statements are executed and there are no more results to fetch.

See Section 25.2.9, “C API Handling of Multiple Query Execution”.

Return Values

Return Value Description
0 Successful and there are more results
-1 Successful and there are no more results
>0 An error occurred

Errors

  • CR_COMMANDS_OUT_OF_SYNC

    Commands were executed in an improper order. For example if you didn't call mysql_use_result() for a previous result set.

  • CR_SERVER_GONE_ERROR

    The MySQL server has gone away.

  • CR_SERVER_LOST

    The connection to the server was lost during the query.

  • CR_UNKNOWN_ERROR

    An unknown error occurred.


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