Fail on database errors
Moved real_escape_string from completer query, to inputs