I am running multiple deletes through mysqli::multi_query and it is messing up the next query in line. The following error is being thrown.
mysqli::multi_query
Er
This helped me to remove 'Commands out of sync' error:
do { $mysqli_conn_obj->use_result(); }while( $mysqli_conn_obj->more_results() && $mysqli_conn_obj->next_result() );
Add this code just after calling multi_query, it will use the result sets and resolve the error.