DEBUG: print select query to error div