Title: Displaying fields from a separate plugin table
Last modified: August 19, 2016

---

# Displaying fields from a separate plugin table

 *  [midweek](https://wordpress.org/support/users/midweek/)
 * (@midweek)
 * [15 years ago](https://wordpress.org/support/topic/displaying-fields-from-a-separate-plugin-table/)
 * Hi – on my blog posts, I want to display one or two fields from a events plugin
   table into the relevant blog post.
 * So lets say my plugin uses a table called “Events”
 * How, in my Single Post page code, could I query the “events” table to extract
   one or two fields for that post, ie: Date, City etc
 * I’m totally new at this…

Viewing 1 replies (of 1 total)

 *  [superyetkin](https://wordpress.org/support/users/superyetkin/)
 * (@superyetkin)
 * [15 years ago](https://wordpress.org/support/topic/displaying-fields-from-a-separate-plugin-table/#post-2075485)
 * Yes, you can.
 * $res = $wpdb->get_results(“SELECT Date, City FROM ” . $wpdb->prefix . “events”);
   
   foreach ($res as $e) { … }
 * [Donate](http://dev.univerpedi.com/donate/) if this helps you.

Viewing 1 replies (of 1 total)

The topic ‘Displaying fields from a separate plugin table’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 2 participants
 * Last reply from: [superyetkin](https://wordpress.org/support/users/superyetkin/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/displaying-fields-from-a-separate-plugin-table/#post-2075485)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
