wpdb last query
snippet in php

wpdb last query

user5370

// Print last SQL query string
echo $wpdb->last_query;