global $wpdb; $wpdb->get_results(" -- YOUR QUERY "); -- get_results IT RETURNS AN ARRAY IF QUERY HAS 1 OR MORE ROWS echo $wpdb->num_rows;