If your program uses CALL
statements to execute stored procedures, the
CLIENT_MULTI_RESULTS flag must be enabled.
This is because each CALL returns
a result to indicate the call status, in addition to any result
sets that might be returned by statements executed within the
procedure. Because CALL can
return multiple results, process them using a loop that calls
mysql_next_result() to determine
whether there are more results.

CLIENT_MULTI_RESULTS can be enabled when you
call mysql_real_connect(),
either explicitly by passing the
CLIENT_MULTI_RESULTS flag itself, or
implicitly by passing CLIENT_MULTI_STATEMENTS
(which also enables CLIENT_MULTI_RESULTS). In
MySQL 5.7, CLIENT_MULTI_RESULTS
is enabled by default.

It is also possible to test whether there are more results by
calling mysql_more_results().
However, this function does not change the connection state, so
if it returns true, you must still call
mysql_next_result() to advance
to the next result.