this is stated in the main mysqli section under constants, but isn't stated here: to get a get a buffered result set, use MYSQLI_STORE_RESULT in your query or call mysqli_store_result() when fetching the result set from a prepared query. this allows you to get the right rowcount every time, since your result set is going to be atomic.
don't forget that whether or not you really want to buffer the result set is a different question altogether.