Title: SQL Query question
Last modified: August 19, 2016

---

# SQL Query question

 *  [Dario D.](https://wordpress.org/support/users/dario-d/)
 * (@dario-d)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/sql-query-question-1/)
 * Under phpMyAdmin, I ran an SQL query to turn off all comments on all articles
   at once, and it said it modified something like 3,000 strings (or lines, or whatever.
   I don’t remember). Does this make sense? I only have 30 or so articles.
 * The query was:
 *     ```
       UPDATE wp_posts
       SET comment_status = 'closed', ping_status = 'closed';
       ```
   

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

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/sql-query-question-1/#post-1834098)
 * The wp_posts table stores posts, pages, attachments, and revisions (and possibly
   other things), so you changed all of them – 3000 rows. This may be OK, depending
   on how the other types of rows use that status.
 *  Thread Starter [Dario D.](https://wordpress.org/support/users/dario-d/)
 * (@dario-d)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/sql-query-question-1/#post-1834117)
 * Dang, thanks.
 * So, issue #2 is restoring my backed up mySQL database. I backed it up before 
   running that query, but, upon restoring, I ran into an error that said:
    “Duplicate
   entry ‘408’ for key 1”
 * Any ideas?
 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/sql-query-question-1/#post-1834244)
 * Depending on how the backup was done you might have to either drop or truncate
   the tables in the database before you can restore.

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

The topic ‘SQL Query question’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * Last activity: [15 years, 5 months ago](https://wordpress.org/support/topic/sql-query-question-1/#post-1834244)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
