last query in wp code example Example: wpdb last query // Print last SQL query string echo $wpdb->last_query;