Title: Import query from wordpress database into template
Last modified: August 19, 2016

---

# Import query from wordpress database into template

 *  Resolved [daztayor](https://wordpress.org/support/users/daztayor/)
 * (@daztayor)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/import-query-from-wordpress-database-into-template/)
 * Hi, I’ve looked everywhere but to be honest I don’t really know where to start.
   I’ve tried this link with no success.
    [http://codex.wordpress.org/Function_Reference/wpdb_Class](http://codex.wordpress.org/Function_Reference/wpdb_Class)
 * Basically I’m trying to import some data from the existing database onto a custom
   template.
    The table in the database exists (wp_store_locator) is populated from
   a plugin (store locator) and I’m trying to take the data fields (sl_phone) from
   these fields and place them on different pages within the site based on the page
   id. I get the <?php $wpdb->query(‘query’); ?> but I don’t know what the query
   is or where to start.

The topic ‘Import query from wordpress database into template’ is closed to new 
replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [Import](https://wordpress.org/support/topic-tag/import/)
 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)
 * [query](https://wordpress.org/support/topic-tag/query/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [daztayor](https://wordpress.org/support/users/daztayor/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/import-query-from-wordpress-database-into-template/)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
