Title: Query return codes
Last modified: August 22, 2016

---

# Query return codes

 *  [LjasonH](https://wordpress.org/support/users/ljasonh/)
 * (@ljasonh)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/query-return-codes/)
 * Ello.
 * Google seems to have very little (or my search keywords are terrible) about the
   return codes on queries such as updating, deleting.
 * Would 0 or 1 be a successful return?

Viewing 1 replies (of 1 total)

 *  [Rastislav Lamos](https://wordpress.org/support/users/lamosty/)
 * (@lamosty)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/query-return-codes/#post-5623687)
 * Assuming you mean using **WP_Query** class to query posts for example, the best
   way of getting this information is either reading [WP_Query Codex](http://codex.wordpress.org/Class_Reference/WP_Query)
   and/or looking into the source code of WordPress (file `wp-includes/query.php`
   or [query.php on WordPress SVN repo](https://core.trac.wordpress.org/browser/tags/4.1/src/wp-includes/query.php#L0)).
 * For example, function `query_posts()` returns array of posts when successful 
   or an empty array if there are no queried posts (as far as I can see from the
   source code).

Viewing 1 replies (of 1 total)

The topic ‘Query return codes’ is closed to new replies.

## Tags

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

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 2 participants
 * Last reply from: [Rastislav Lamos](https://wordpress.org/support/users/lamosty/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/query-return-codes/#post-5623687)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
