Title: Database Error
Last modified: August 18, 2016

---

# Database Error

 *  [JamesM](https://wordpress.org/support/users/righton/)
 * (@righton)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/database-error-1-4/)
 * For some strange reason only when all topics in a category are displayed, I get
   the following dbase error.
 * **WordPress database error:**_ [No Database Selected]
    SELECT COUNT(ID) FROM 
   main\_posts LEFT JOIN main\_post2cat ON (main\_posts.ID = main\_post2cat.post\
   _id) WHERE 1=1 AND (category\_id = 1) AND post\_date\_gmt <= ‘2005-06-14 02:45:
   59’ AND (post\_status = “publish”)
 * But when I select JUST one topic, it goes away. Odd thing is, I didn’t change
   anything, it just started happening today.

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

 *  [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * (@vkaryl)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/database-error-1-4/#post-220098)
 * If you didn’t do anything at all, then you might like to check with your host(
   assuming this is on a hosted server and not local) to see if they “upgraded” 
   anything.
 *  Thread Starter [JamesM](https://wordpress.org/support/users/righton/)
 * (@righton)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/database-error-1-4/#post-220103)
 * the only thing I did was add, then remove the following from my header.php:
 * <?php @include_once($_SERVER[“DOCUMENT_ROOT”].”/shortstat/inc.stats.php”); ?>
 * After installation, error wasn’t there. After I removed it, nothing… then 20 
   min later, error.

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

The topic ‘Database Error’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [JamesM](https://wordpress.org/support/users/righton/)
 * Last activity: [20 years, 11 months ago](https://wordpress.org/support/topic/database-error-1-4/#post-220103)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
