In this example, we first establish a connection to the database using the mysqli_connect() function. We then execute a multi-query that selects all rows from two different tables using mysqli_multi_query() function. Next, we retrieve the result sets using mysqli_store_result() function. We fetch the rows from the first query using mysqli_fetch_assoc() function and process it. Here, the mysqli_next_result() function is used to retrieve the next result set. The while loop continues until all the result sets are retrieved. In this example, mysqli_next_result() belongs to the mysqli extension, and thus, it is a part of the mysqli library.