What if the mysql stored procedure returns two or more query results and how to handle those results sets in php
Generally you need to use the mysqli query and use the mysqli_multi_query function. Haven't tested but this should get you on the right track. $db = new mysqli(.....); $my_sp_query = "call my_sp()"; if($query = $db->multi_query($my_sp_query)) { $result_array = array(); while($query->next_result()) { if($result = $query->store_result() { //you can use the $result_array for later, or you can execute / print stuff here $result_array[] = $result->fetch_array(); $result->free_result(); } } } PHP:
It is fairly standard with most php5 installs. You can use a phpinfo to tell if the mysqli functions are enabled.