Title: How is the table wp_posts structured?
Last modified: August 19, 2016

---

# How is the table wp_posts structured?

 *  [bobcooper](https://wordpress.org/support/users/bobcooper/)
 * (@bobcooper)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/how-is-the-table-wp_posts-structured/)
 * Hi there,
 * I am using AMFPHP to get my blog posts from the database so that I can then get
   at the info from inside flash. It’s all working fine, but the problem is the 
   order… When I look at wp_posts.post_title the order is very strange, and some
   of my posts are repeated.
 * I am assuming this has something to do with having multiple categories for each
   post so they get duplicated.
 * I was wondering how wordpress organises the posts so that they display in the
   right order, am I using the correct tables?
 * Thanks,
 * Bob
    [sig moderated – read the rules]

Viewing 1 replies (of 1 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/how-is-the-table-wp_posts-structured/#post-907561)
 * A valid post has, in wp_posts, a post_type of ‘post’ and a post_status of ‘publish’.
   A draft post has a post_type of ‘draft’.
 * A post revision has, in wp_posts, a post_type of ‘revision’ and a post_status
   of ‘inherit’. A revision is a ‘previous’ copy of a post. There could be many 
   revisions of the same post.
 * A valid [page](http://codex.wordpress.org/Pages) has a post_type of ‘page’ and
   a post_status of ‘publish’. A draft page has a post_type of ‘draft’.
 * An attachment to a post/page has a post_type of ‘attachment’.
 * As a note, a post with 15 categories or tags will have but one record (assuming
   no revisions) in wp_posts, but will have 15 entries in the wp_term_relationships
   table.

Viewing 1 replies (of 1 total)

The topic ‘How is the table wp_posts structured?’ is closed to new replies.

## Tags

 * [amfphp](https://wordpress.org/support/topic-tag/amfphp/)
 * [database](https://wordpress.org/support/topic-tag/database/)
 * [flash](https://wordpress.org/support/topic-tag/flash/)
 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)
 * [order](https://wordpress.org/support/topic-tag/order/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [MichaelH](https://wordpress.org/support/users/michaelh/)
 * Last activity: [17 years, 5 months ago](https://wordpress.org/support/topic/how-is-the-table-wp_posts-structured/#post-907561)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
