Title: two query in a same php file
Last modified: August 18, 2016

---

# two query in a same php file

 *  [austinepower007](https://wordpress.org/support/users/austinepower007/)
 * (@austinepower007)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/two-query-in-a-same-php-file/)
 * I am using two separate wordpress
    1) wordpress 2)wordpress_news
 * one for blog and another for news …i made a php file which query to wordpress_news
   just to retrive some data from database. I include this file into table into 
   the index of wordpress …but when i enter wordpress blog it shows me error on 
   sidebar on recent topic.
 * error is: wordpress database error:
 * can’t show any recent topic

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

 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/two-query-in-a-same-php-file/#post-493123)
 * If you have two (2) WP installations: A and B, and while on blog B you try to
   retrieve data from the database A without specifying the database, the script
   will look into the B database – and not finding it.
 *  [utopisch](https://wordpress.org/support/users/utopisch/)
 * (@utopisch)
 * [19 years, 5 months ago](https://wordpress.org/support/topic/two-query-in-a-same-php-file/#post-493206)
 * Wouldn’t it be easier to make a ‘News’ category, exclude it from category list
   using [`wp_list_cats()`](http://codex.wordpress.org/Template_Tags/wp_list_cats),
   and display it on the (static) index page using [`query_posts()`](http://codex.wordpress.org/Template_Tags/query_posts)?
 * Just an opinion, because i’m trying this on my localhost 🙂

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

The topic ‘two query in a same php file’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [utopisch](https://wordpress.org/support/users/utopisch/)
 * Last activity: [19 years, 5 months ago](https://wordpress.org/support/topic/two-query-in-a-same-php-file/#post-493206)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
