I have some questions about using MySQLi, queries, and related memory management. The code here is just to clarify my questions, so don\'t dump on it for error checking, etc. I
Thanks for all the answers, I'd also like to add my experiences of running multiple MySQL queries in one script. Mysqli gave “Commands out of sync” errors after running a query after a MySql procedures with multiple queries. To solve this I had to free all the open result sets using rizwan-mirza's solution to mysqli_free_result()
any mysqli_more_results()
https://stackoverflow.com/a/25907704/462781