Title: Database queries from within the loop
Last modified: August 20, 2016

---

# Database queries from within the loop

 *  Resolved [joemastro](https://wordpress.org/support/users/joemastro/)
 * (@joemastro)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/database-queries-from-within-the-loop/)
 * Howdy all.
 * I’m working on learning wp_query, but have run into a problem.
 * I want to get most of the meta values for a post, regardless of their value. 
   From what I have been reading, the suggestion is to use get_post_meta() from 
   within the loop.
 * I’m kind of a hack, but I do remember it being repeated that you don’t run a 
   query while looping through a query…. get_post_meta is a query, and the loop 
   processes a query.
 * What the heck am I missing?
 * Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Andrew Bartel](https://wordpress.org/support/users/andrew-bartel/)
 * (@andrew-bartel)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/database-queries-from-within-the-loop/#post-3462647)
 * Oh it’s fine don’t worry. What you’re reading about is running a “query” that
   would create a secondary loop while you’re already in a loop.
 *  Thread Starter [joemastro](https://wordpress.org/support/users/joemastro/)
 * (@joemastro)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/database-queries-from-within-the-loop/#post-3462903)
 * Ah.. Thank you! Sorry for the late response…. trying to figure out the Walker.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Database queries from within the loop’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [get_post_meta](https://wordpress.org/support/topic-tag/get_post_meta/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [joemastro](https://wordpress.org/support/users/joemastro/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/database-queries-from-within-the-loop/#post-3462903)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
