Correct way to perform non-cacheable DB query

I am not completely sure what you are talking about so I will mention the possibilities that come to mind. Maybe this… // Keep track of the last query for debug.. $this->last_query = $query; http://core.trac.wordpress.org/browser/tags/3.5.2/wp-includes/wp-db.php#L1195 … is what you are talking about. If so, your code just runs the flush method which resets $wpdb properties … Read more

One query to get posts and their taxonomy terms

According to user Otto, who provides a good explanatory answer to a similar question, you can safely call wp_get_post_terms() a number of times because WordPress’s internal query caching system is primed before the loop begins, and subsequent calls to wp_get_post_terms() will hit the cache rather than the query: Post meta information is automatically cached in … Read more

Debugging WordPress

The basic technique of logging queries is that if SAVEQUERIES constant is defined to be true (it’s not by default for performance reasons) then $wpdb->queries will keep the log of queries performed. There isn’t anything on top of this that WordPress natively does. There are plenty of plugins around which work either by interpreting this … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)