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

1 Answer 1


In the code you posted in your other question, your call to flush() is using the wrong variable: $wpdp->flush();.

Since this is an undefined variable, it's likely that you're simply getting a PHP runtime error at this point, stopping page execution.

  • The $wpdb->flush() does exist according to The Codex
    – Joshua
    Commented Dec 14, 2011 at 3:32
  • 1
    Yes, $wpdb does exist, but $wpdp does not exist. Notice the difference, mainly in the spelling.
    – Otto
    Commented Dec 14, 2011 at 22:05
  • 1
    Touche, my good sir.
    – Joshua
    Commented Dec 14, 2011 at 23:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.