$wpdb->flush(); breaks the loop

I am using $wpdb->flush(); at the base of my page in an attempt to prevent the query executing multiple times due to caching however it seems that it isn’t flushing the most recent query but the entire cache as my page is not loading past generating my content.

Possibly Relevant information:

  • I am using the exec-php plugin and consequently this page is entirely php
  • I am also having another possibly related problem as detailed here

Solutions Collecting From Web of "$wpdb->flush(); breaks the loop"