You can try this with WP_User_Query
instead:
$args = array (
'meta_query' => array(
array(
'key' => 'newsletter',
'value' => 'true',
),
array(
'key' => 'account',
'value' => 'false',
),
),
'date_query' => array(
array(
'after' => '2015-01-13 00:00:00',
'inclusive' => true,
),
),
);
$user_query = new WP_User_Query( $args );
where I assume your user meta values are boolean strings, i.e. 'true'
and 'false'
.
Related Posts:
- How to use $wpdb to delete in a custom table
- get_results on large datasets
- Is there a (better) way to access $wpdb results?
- Using $wpdb generates DB error
- How do you use prepare when asking for a list of id’s
- how to execute different sql query in non-sanitized $wpdb->get_results function
- WPDB update row with != in where clause
- How to update records using $wpdb?
- Need help writing a $wpdb query
- show badge with count for pending items in custom post type
- WordPress SQL query – returning ‘true’ ‘false’ or ‘null’
- Modify the structure of data returned by $wpdb
- Syntax for $wpdb->prepare when searching in two columns
- Confused by $wpdb->prepare
- How to display user_nicename and usermeta values by custom query in WordPress?
- Optimizing WordPress Queries – Removing Group By ID
- How can I combine one field using wpdb and group by?
- $wpdb->prepare with ON DUPLICATE KEY UPDATE
- how to use $wpdb->prepare to update a custom table
- WPDB Placeholders and second argument for prepared statements
- Increment integer field in database when WHERE needs to be dynamic [closed]
- Custom SQL query ORDER BY term_order
- Custom $wpdb returns unexpected time based results
- How to left join meta in queries [closed]
- wpdb->get_row is selecting the variable as a column name
- CREATE TABLE with dbDelta does not create table
- $wpdb query outputs php code instead of executing it
- wpdb query not working
- WordPress wpdb->insert returns int(0) => doesn’t insert anything, no errors!
- WPDB SQL Ignore `post_status` Parameter
- how to list all post that are in the custom taxonomy using $wpdb
- WPDB SQL query SELECT from category
- How to use WHERE NOT EXISTS query to avoid duplicate entry using $wpdb to save in custom table?
- Creating an Angular factory from custom database table
- wpdb->update update the entire table instead of one row
- How do I update post based on meta_key in another table?
- How to set up prepared query using IN statement
- Custom database query to validate data
- Alter the main search query to search posts by coauthor user name
- Creates only one table and not the other
- Protect custom form from SQL injection
- looking for a way to allow users to backup the plugin db data(save as)
- SQL Query to select post title & post ID from a particular category
- Get comments after specific date
- query using wpdb in wordpress gets me no result
- Get count of rows based if column exists in two different tables
- query_vars doesn’t return query string (trying to get data from $wpdb)
- Matching database content types to PHP types
- Use wpdb->prepare for `order by` column name
- wpdb->prepare function remove single quote for %s in SQL statment
- Saving custom form data into database
- wp-content/db.php : where is this file?
- $wpdb->get_results() returns good result only in first foreach iteration
- $wpdb->insert – inserting multiple rows
- WPDB->insert with special characters
- $wpdb->prepare not working with update table prefix
- How to use prepare to query with variables
- Use $wpdb in wordpress theme files
- get posts and postmetas in assoc array
- wpdb->get_row() / get_results – is it possible to return an object instances of my own class?
- Problem in creating table through plugin code
- $wpdb – do you have to use foreach even if there will always only be one result?
- wpdb_prepare with multiple or condition
- $wpdb->insert query changes to SHOW COLUMNS query Output
- Fixing wpdb->get_results and wpdb->prepare?
- How does the WXR file differ from the WPDB?
- WPDB If primary key already exists, add +1 to integer field
- How to get an array of user roles with or without a specific capability?
- Programmatically Creating Page using $wpdb and getting 404 error
- Create table from array with prepare
- 301 Redirect Code
- wpdb query problem to access previous 3 days posts
- $wpdb->insert inserting only f character in custom table
- Why does wpdb->update delete other meta?
- Make a SQL query with wpdb in WordPress
- Getting variable from Database
- How to optimize multiple insert into wordpress database
- PHP -> SQL Query with Summing
- How to delete a particular row in a database table
- Get emails from users by custom field SQL
- Save sql file after doing insert wpdb
- Can I use wpdb to insert query results into a post?
- Getting value from database table depending on field value
- $wpdb->prepare error after WordPress update [duplicate]
- How to pass an input value into wpdb->Prepare
- WordPress SQL Prepare
- wpdb replace returning 1 where delete and insert is expected
- update_post_meta not working in template_redirect action
- How to work with constraints on wordpress user metadata?
- Help posting values to DB on submit using $wpdb->query
- Get 3 row ID’s via ARRAY_A
- Getting record from three wpdb tables
- wpdb insert working in one function, but not another
- wpdb select from using array as search parameters
- wpdb Cannot Access Associative Array Data in a Count Query
- Can’t get expected result from a wpdb query
- selecting row using wpdb which contain special symbols
- Query Problem in Clustom Plugin
- $wpdb The query does not contain the correct number of placeholders
- $wpdb:insert, more arguements in $format array than in $data