Title: SELECT FROM wp_posts
Last modified: August 18, 2016

---

# SELECT FROM wp_posts

 *  [Mads Phikamphon](https://wordpress.org/support/users/madsphi/)
 * (@madsphi)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/select-from-wp_posts/)
 * Aloha,
 * I try to execute the following query, but I always get 0 rows back 🙁
 * SELECT id, post_name, post_date FROM wp_posts WHERE guid = ‘2e9e0429-4d51-4452-
   a942-124e85478e30’
 * There is a row in wp_posts with the specified guid, so I really don’t understand
   why I can’t retrieve it with my query?
 * One other thing: What method is used to determine the post slug? I have noticed
   that it makes sure post slug are unique, so I would love to use that functionality
   in my upload script.
 * Thank you.

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

 *  [viper007bond](https://wordpress.org/support/users/viper007bond/)
 * (@viper007bond)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/select-from-wp_posts/#post-465410)
 * > What method is used to determine the post slug?
 * The function `sanitize_title_with_dashes()`.
 *  Thread Starter [Mads Phikamphon](https://wordpress.org/support/users/madsphi/)
 * (@madsphi)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/select-from-wp_posts/#post-465412)
 * Thanks for the method name.
 * I found my SQL error – it was one of the elusive error 40 that sometimes occurs
   if you don’t focus on the right areas of the window…

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

The topic ‘SELECT FROM wp_posts’ is closed to new replies.

## Tags

 * [select](https://wordpress.org/support/topic-tag/select/)
 * [slug](https://wordpress.org/support/topic-tag/slug/)
 * [sql](https://wordpress.org/support/topic-tag/sql/)
 * [wp_posts](https://wordpress.org/support/topic-tag/wp_posts/)

 * 2 replies
 * 2 participants
 * Last reply from: [Mads Phikamphon](https://wordpress.org/support/users/madsphi/)
 * Last activity: [19 years, 8 months ago](https://wordpress.org/support/topic/select-from-wp_posts/#post-465412)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
