• Resolved abonne

    (@abonne)


    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

    (@tugbucket)

    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

    (@abonne)

    AWESOME! Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Database query….in new page?’ is closed to new replies.