Title: Database Query Help
Last modified: September 25, 2024

---

# Database Query Help

 *  Resolved [eberkland](https://wordpress.org/support/users/eberkland/)
 * (@eberkland)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/database-query-help/)
 * HI, I’m new to the database query game.
 * I have this query that selects posts for use in a database filter calculation:
 * SELECT post.post_title,post.post_excerpt,post.post_date,post.guid,user.display_name
   FROM {wpdb.posts} post INNER JOIN {wpdb.users} as user ON (post.post_author=user.
   ID) WHERE post.post_title LIKE “%<%fieldname2%>%” OR post.post_excerpt LIKE “%
   <%fieldname2%>%” OR post.post_content LIKE “%<%fieldname2%>%”
 * I just want to call my custom posts. My custom post name is price_book. How would
   I do this.
 * I would greatly appreciate any help.
 * Thanks!

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

 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [1 year, 8 months ago](https://wordpress.org/support/topic/database-query-help/#post-18036231)
 * Out of curiosity, is there any reason why you’re not using the `WP_Query` class
   to pull some posts?
 * Beyond that, this feels like a search query for posts by the current user. What
   is `fieldname` coming from?
 * Beyond that that, not really a topic that our plugin necessarily covers, as our
   purpose is to get the content types registered, not so much what gets done with
   the content afterwards.
 *  Thread Starter [eberkland](https://wordpress.org/support/users/eberkland/)
 * (@eberkland)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/database-query-help/#post-18038380)
 * I found another direction to go since my question, but still am having issues.
 * I am creating a pricing calculator using the calculated field form plugin and
   I want to create a pop up on the page that shows posts related to the product
   being priced.
 * The plugin allows for setting variables on pages and then calling them, but this
   is not working. I am wondering if it is because the pages I am referencing are
   custom post types… here is some details on how this plugin sets variables [https://cff.dwbooster.com/documentation/#javascript-variables](https://cff.dwbooster.com/documentation/#javascript-variables)
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [1 year, 8 months ago](https://wordpress.org/support/topic/database-query-help/#post-18038580)
 * This is going to be a question better fit for the Calculated Fields Form developers
   than us. They know the capabilities of their plugin way more than we do, including
   if it’d be possible to use content types the way you’re trying to do things with.

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

The topic ‘Database Query Help’ is closed to new replies.

 * ![](https://ps.w.org/custom-post-type-ui/assets/icon-256x256.png?rev=2744389)
 * [Custom Post Type UI](https://wordpress.org/plugins/custom-post-type-ui/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-post-type-ui/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-post-type-ui/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-post-type-ui/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-post-type-ui/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-post-type-ui/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [1 year, 8 months ago](https://wordpress.org/support/topic/database-query-help/#post-18038580)
 * Status: resolved