Title: Error in your SQL Query syntax
Last modified: April 13, 2021

---

# Error in your SQL Query syntax

 *  Resolved [courageous999](https://wordpress.org/support/users/courageous999/)
 * (@courageous999)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/error-in-your-sql-query-syntax/)
 * `[13-Apr-2021 14:02:38 UTC] PHP Warning: preg_match(): Compilation failed: number
   too big in {} quantifier at offset 31 in /home/user/public_html/wp-content/plugins/
   ultimate-member/includes/core/class-member-directory.php on line 1481`
 *     ```
       [13-Apr-2021 14:02:38 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= 'travis' 
               OR 
               mt3.meta_value LIKE '%travis%' 
               OR 
           ' at line 13 for query SELECT DISTINCT SQL_CALC_FOUND_ROWS wp_users.ID FROM wp_users LEFT JOIN wp_usermeta ON ( wp_users.ID = wp_usermeta.user_id )  LEFT JOIN wp_usermeta AS mt1 ON ( wp_users.ID = mt1.user_id )  LEFT JOIN wp_usermeta AS mt2 ON (wp_users.ID = mt2.user_id AND mt2.meta_key = 'pp_rank' )  LEFT JOIN wp_usermeta AS mt3 ON ( wp_users.ID = mt3.user_id )  LEFT JOIN wp_usermeta AS mt4 ON ( wp_users.ID = mt4.user_id ) WHERE 1=1 AND ( 
         ( 
           ( 
             ( wp_usermeta.meta_key = 'um_member_directory_data' AND wp_usermeta.meta_value LIKE '%s:14:\"account\\_status\";s:8:\"approved\";%' ) 
             AND 
             ( 
               mt1.meta_key = 'pp_rank' 
               OR 
               mt2.user_id IS NULL
             ) 
             AND 
             ( 
               mt3user_login LIKE '%travis%' OR user_url LIKE '%travis%' OR display_name LIKE '%travis%' OR user_email LIKE '%travis%' OR user_nicename LIKE '%travis%' OR .meta_value = 'travis' 
               OR 
               mt3.meta_value LIKE '%travis%' 
               OR 
               mt3.meta_value LIKE '%s:6:\"travis\";%'
             )
           ) 
           AND 
           ( 
             ( 
               ( mt4.meta_key = 'wp_capabilities' AND mt4.meta_value LIKE '%\"um\\_client-npg\"%' ) 
               OR 
               ( mt4.meta_key = 'wp_capabilities' AND mt4.meta_value LIKE '%\"um\\_free-npg\"%' )
             )
           )
         )
       ) ORDER BY CAST(mt1.meta_value AS SIGNED) ASC, user_login ASC LIMIT 0, 12 made by do_action('wp_ajax_nopriv_um_get_members'), WP_Hook->do_action, WP_Hook->apply_filters, um\core\Member_Directory->ajax_get_members, WP_User_Query->__construct, WP_User_Query->query
       ```
   
 * Your plugin has been throwing those 2 errors for about a couple months intermittently
   now. I don’t know how to replicate it or when it’s happening. I just keep seeing
   it in the error_log.
 * Just off eye inspection alone, you can see that after the 2nd AND in the query
   there’s a “mt3user_login” which seems like an error since “mt3” shouldn’t be 
   there. Furthermore, in that same line you have a “OR .meta_value = ‘travis'” 
   where it seems like the “mt3” should be just before that dot (which is what the
   2nd error is complaining about). I’m not sure how this query has passed your 
   testing or how it’s been running all this time without causing massive issues.

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

 *  Plugin Contributor [Champ Camba](https://wordpress.org/support/users/champsupertramp/)
 * (@champsupertramp)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/error-in-your-sql-query-syntax/#post-14315852)
 * Hi [@courageous999](https://wordpress.org/support/users/courageous999/)
 * Could you please tell us what version of UM installed on your site? Also, which
   WP version you’re using?
 * Regards,
 *  Thread Starter [courageous999](https://wordpress.org/support/users/courageous999/)
 * (@courageous999)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/error-in-your-sql-query-syntax/#post-14318159)
 * UM 2.1.16
    WP 5.7 PHP 7.4.16
 *  Thread Starter [courageous999](https://wordpress.org/support/users/courageous999/)
 * (@courageous999)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/error-in-your-sql-query-syntax/#post-14337854)
 * So what’s the diagnosis chief?
 *  Plugin Contributor [Champ Camba](https://wordpress.org/support/users/champsupertramp/)
 * (@champsupertramp)
 * [5 years ago](https://wordpress.org/support/topic/error-in-your-sql-query-syntax/#post-14428947)
 * Hi [@courageous999](https://wordpress.org/support/users/courageous999/)
 * Sorry for the late response. Could you please tell us if you’re having issues
   with the latest version 2.1.20?
 * Regards,
 *  Plugin Contributor [Champ Camba](https://wordpress.org/support/users/champsupertramp/)
 * (@champsupertramp)
 * [5 years ago](https://wordpress.org/support/topic/error-in-your-sql-query-syntax/#post-14478871)
 * Hi [@courageous999](https://wordpress.org/support/users/courageous999/)
 * Please feel free to re-open this thread by changing the Topic Status to ‘Not 
   Resolved’ if any other questions come up and we’d be happy to help. 🙂
 * Regards,

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

The topic ‘Error in your SQL Query syntax’ is closed to new replies.

 * ![](https://ps.w.org/ultimate-member/assets/icon-256x256.png?rev=3160947)
 * [Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin](https://wordpress.org/plugins/ultimate-member/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-member/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-member/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-member/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-member/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-member/reviews/)

## Tags

 * [meta_value)](https://wordpress.org/support/topic-tag/meta_value/)
 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)
 * [select](https://wordpress.org/support/topic-tag/select/)

 * 5 replies
 * 2 participants
 * Last reply from: [Champ Camba](https://wordpress.org/support/users/champsupertramp/)
 * Last activity: [5 years ago](https://wordpress.org/support/topic/error-in-your-sql-query-syntax/#post-14478871)
 * Status: resolved