output sql statement wpdb->query insert into prepare code example Example: wpdb last query // Print last SQL query string echo $wpdb->last_query;