[eluser]OverZealous[/eluser] @introvert
If you'd read the docs, you'd see that check_last_query, by default, renders to the browser automatically. If you are also echoing it, you'll get the same output twice.
Obviously that would cause a database error if it tried to execute that.