27.05.2016, 09:43
You're going to have problems with memory leaks because you never delete the result (which you never store in the first place).
Other than that, I want to say 2 more things. You keep calling cache_num_rows for each iteration, store it to a variable to avoid that and use threaded queries.
Other than that, I want to say 2 more things. You keep calling cache_num_rows for each iteration, store it to a variable to avoid that and use threaded queries.