Title: Database query&#8230;.in new page?
Last modified: August 19, 2016

---

# Database query….in new page?

 *  Resolved [abonne](https://wordpress.org/support/users/abonne/)
 * (@abonne)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/database-queryin-new-page/)
 * Hi,
 * I am new to WordPress 2.9.1. My apologies if it is not the right forum.
 * We have an app that captures customer calls. Call info is stored in a different
   MYSQL DB, same WP server.
 * On my blog, I have created a new page called “Outstanding calls” and I would 
   like it to display the results of a query from the customer calls DB.
 * I have successfully created a PHP script that performs what I describe here ;
   it displays the results in a HTML table.
 * Reading the documentation, I discovered the `wpdb` class. It reads that $wpdb
   object can be used to read data from any table in the WordPress database.
 * This means its use is limited to the WP database, correct? Is there a way to 
   do that in the page of my blog?
 * Thanks for your help.
 * Al.

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

 *  [tugbucket](https://wordpress.org/support/users/tugbucket/)
 * (@tugbucket)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/database-queryin-new-page/#post-1412488)
 * yes wpdb will only read the db you created on install.
 * If what you are asking if how to get your query to show up in a wp page then 
   you can open page.php and write something like this:
 *     ```
       <?php if is_page('YOUR-PAGE-NAME'){
   
       //all your custom query code goes here
   
       } ?>
       ```
   
 * Then in the admin, make a page called ‘YOUR-PAGE-NAME’.
 * voila
 *  Thread Starter [abonne](https://wordpress.org/support/users/abonne/)
 * (@abonne)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/database-queryin-new-page/#post-1412501)
 * AWESOME! Thank you.

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

The topic ‘Database query….in new page?’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [abonne](https://wordpress.org/support/users/abonne/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/database-queryin-new-page/#post-1412501)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
