Title: Getting DB error on using pods () function
Last modified: May 14, 2023

---

# Getting DB error on using pods () function

 *  Resolved [newbiedev](https://wordpress.org/support/users/newbiedev/)
 * (@newbiedev)
 * [3 years ago](https://wordpress.org/support/topic/getting-db-error-on-using-pods-function/)
 * Hi
 * I’ve created a pod “movies” with “language” as one of the fields.
 * Now I’m trying to create a page where I’m trying to filter all movies where language
   is not “English”.
 * I’m using the below code, but getting the error as second code block below. Could
   you help what am I doing wrong?
 *     ```wp-block-code
       $params = [
       	'limit'   => 25,
       	'where' => 't.language != "English"',
       ];
       $mypod = pods( 'movies', $params );
   
       //$mypod = pods( 'mypod' )->find( $params );
       // Loop through the items returned.
       while ( $mypod->fetch() ) {
       	echo '<p>' . $mypod->display( 'ms_title' ) . '</p>';
       }
       ```
   
 *     ```wp-block-code
       Database Error; SQL: SELECT
   
                       DISTINCT
                       t.*
                       FROM wp_kekc_posts AS t
   
                       WHERE ( ( t.language != "English" ) AND ( t.post_type = 'movies' ) AND ( t.post_status IN ( 'publish' ) ) )
   
   
                       ORDER BY t.menu_order, t.post_title, t.post_date
                       LIMIT 0, 25; Response: Unknown column 't.language' in 'where clause'
       ```
   

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

 *  Plugin Author [Jory Hogeveen](https://wordpress.org/support/users/keraweb/)
 * (@keraweb)
 * [3 years ago](https://wordpress.org/support/topic/getting-db-error-on-using-pods-function/#post-16745444)
 * Hi [@newbiedev](https://wordpress.org/support/users/newbiedev/)
 * Field aren’t object params but metadata so it should be `language.meta_value`.
 * Also, make sure that the actual value is `English` and not lowercase or and ID.
 * Cheers, Jory
 *  Thread Starter [newbiedev](https://wordpress.org/support/users/newbiedev/)
 * (@newbiedev)
 * [3 years ago](https://wordpress.org/support/topic/getting-db-error-on-using-pods-function/#post-16746492)
 * Thank you for the support!

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

The topic ‘Getting DB error on using pods () function’ is closed to new replies.

 * ![](https://ps.w.org/pods/assets/icon.svg?rev=3286397)
 * [Pods - Custom Content Types and Fields](https://wordpress.org/plugins/pods/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pods/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pods/)
 * [Active Topics](https://wordpress.org/support/plugin/pods/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pods/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pods/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [newbiedev](https://wordpress.org/support/users/newbiedev/)
 * Last activity: [3 years ago](https://wordpress.org/support/topic/getting-db-error-on-using-pods-function/#post-16746492)
 * Status: resolved