Handling query rows
The mi_get_result() function returns a status of MI_ROWS to indicate that a current statement is a query that has successfully executed and a cursor is open. A query can be instigated by a SELECT or an EXECUTE FUNCTION statement. The MI_ROWS statement status does not indicate that rows are in the cursor. If the query has not found any matching rows (the NOT FOUND condition), mi_get_result() still returns MI_ROWS. To retrieve rows from the cursor, use the mi_next_row() statement. If no rows exist in the cursor, mi_next_row() returns a NULL-valued pointer.