Try this.
$query = "SELECT * FROM wp_cf7dbplugin_submits a,wp_cf7dbplugin_submits b WHERE a.field_name="Buyer" AND a.field_value = 1 AND a.submit_time = b.submit_time AND b.field_name = carbrand AND b.field_value="Mercedes"";
global $wpdb;
// return the number of rows found
$results = $wpdb->num_rows($query);
var_dump($results);
Related Posts:
- Ignoring initial articles (like ‘a’, ‘an’ or ‘the’) when sorting queries?
- Should I use Transients with W3 Total Cache APC Caching? [closed]
- Add indexing to meta_value in wp_postmeta
- Get posts by menu ID
- Slow SQL_CALC_FOUND_ROWS Query
- What is an efficient way to query based on post_meta?
- WP_Query Performance Issues with meta_query
- Should close $wpdb via $wpdb->close()
- Get the post permalink within the loop but without additional DB query
- Filter WordPress posts by between parameter
- Retrieve featured image (thumbnail) url from multiple posts with one query
- How To Get Some Data From WordPress Database Using WordPress $wpdb Query?
- What’s faster? One big query, or several smaller ones?
- How WordPress attaches its Featured Images with posts?
- Order by custom table and multiplication
- why update and delete query not worked in custom table?
- How to implement a new row_count method in WordPress?
- wp_Qwery works to slow
- Show all data in database table and make it into an interactive table
- No results found from a $wpdb->get_results() query when trying to join more than one meta key query
- database query with more than a couple meta hangs and doesn’t complete
- How to access custom WordPress database tables
- Is it possible to query from external database? [duplicate]
- WP User Query with Custom Fields and Search Results
- List of ways to access WordPress database?
- Specify strict ‘order by’ in WordPress query
- How to set up hierarchical relationships without using plugins / meta query
- how to get Nearby zipcode
- Does WordPress have something like Drupal’s DB API?
- Using Transients
- Slow Query On Search
- how to write wordpress query for multiple metakeys checking?
- Wpdb->query result show 1 but is not an integer
- Why having more than 10 clauses in WP_Query results in some outputs being dropped?
- Storing an array of objects related to each user
- Retrieve data from wordpress db via input and put those result in dropdown
- WP Query – filtering terms with regex
- WP_Query with page_ids in arguments without a result
- Function to retrieve IDs of posts, cache results, and improve wp_query
- Issue with data array format
- Why last row deleted when refresh page
- Query a database based on form input then output to another page [closed]
- wp query search multi terms
- How to get meta key list efficiently?
- How to get user avatar via WPDB
- How to extend WP_query to a specific table?
- Fix wp_term_relationships slow query in get_posts
- Translating WP query into to SQL query
- update_post_meta performance in a loop woocommerce
- update_post_meta performance in a loop woocommerce
- WP_Term_Query->get_terms() very slow query for WordPress filter
- Separate by Category Post Type
- I removed the “wp_rm_logs” table and am constantly getting this error
- Track write actions to the database
- Include post_status check within $wpdb query
- wpdb get_results() returns only 2 rows
- Website goes slow down after importing long database
- WP_Query always returning the last custom post
- option select form always deleting the sql query
- Optimising amount of calls to custom fields
- 294 Queries on Mainpage of WordPress
- how to add limit records in wordpress query
- Custom WP_query in Jnews theme returns thousands of posts
- WP_Query by meta key not returning any posts
- SQL query into to WP query
- When to use WP_query(), query_posts() and pre_get_posts
- WP query taxonomy input differs to output?
- WP_Query min and max values
- assign 2 $args to one wp_query
- Calling a custom excerpt function in a local loop
- How would I format a query that depends on post parent taxonomy
- Minimising Database Queries when using Advanced Custom Fields
- WP_Query Group by Author and Order each group DESC
- List only posts from specific category on category page
- Most popular post for last 7 days
- WP Pagination on Posts Search Results Page resulting from AJAX WP Query
- Query multiple meta values
- Why isn’t my multiple orderby working?
- WP_Query() order by post content lenght?
- reset to main loop doesnt work
- echo a specific meta_key queried through a custom post
- WP_Query returns posts_per_page + 1 every time
- Merge two search functions for custom post type
- problems with comments_number()
- Get a list of ACF Repeater-Fields as array
- query_vars empty when using custom url with custom rewrite rule
- Attempt to display site authors in a carousel – User Image not Outputting inside li tags
- Why my query is not “Main_query”?
- Facing problem with tax_query results
- How to add a “base” filter for all posts visible to visitors on the site?
- Woocommerce featured products query no longer working
- add action for wordpress query at a specific position
- Updating an intensive wp_query result once daily
- Custom WP_query and integrating into theme file
- new WP_query using custom fields
- Having Trouble Running Query From Shortcode Using Tribe’s Events Plugin
- Change ‘post_modify’ with a query
- An archive page without post format (just standard post)
- Get posts using multiple values from ACF checkbox as meta query wordpress
- Why ignore_sticky_posts argument is in sticky post query?