Title: wordpress wpdb query
Last modified: August 19, 2016

---

# wordpress wpdb query

 *  [rahim701](https://wordpress.org/support/users/rahim701/)
 * (@rahim701)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/wordpress-wpdb-query/)
 * using this code:
 *     ```
       // http://codex.wordpress.org/Displaying_Posts_Using_a_Custom_Select_Query
   
        $querystr = "
           SELECT wposts.*
           FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta
           WHERE wposts.post_title LIKE '%hello%'
           AND wposts.post_type = 'post'
           AND wposts.post_status = 'publish'
        ";
   
        $pageposts = $wpdb->get_results($querystr);
       ```
   
 * check result here:
    [http://demo.htmltiger.com/wpmovie/?page_id=8](http://demo.htmltiger.com/wpmovie/?page_id=8)
 * answer will be one “Hello world!” post.
    but there is 8 posts with same title.
 * at this page, total 10 time.
    [http://demo.htmltiger.com/wpmovie/?page_id=10](http://demo.htmltiger.com/wpmovie/?page_id=10)

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/wordpress-wpdb-query/#post-2001952)
 * [http://codex.wordpress.org/Function_Reference/WP_Query](http://codex.wordpress.org/Function_Reference/WP_Query)
 *  Thread Starter [rahim701](https://wordpress.org/support/users/rahim701/)
 * (@rahim701)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/wordpress-wpdb-query/#post-2001988)
 * can you give me any code with “WHERE wposts.post_title LIKE ‘%hello%'” using 
   wp_query?
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/wordpress-wpdb-query/#post-2002094)
 * **Stop bumping!**

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

The topic ‘wordpress wpdb query’ is closed to new replies.

## Tags

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

 * 3 replies
 * 2 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/wordpress-wpdb-query/#post-2002094)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
