Fix 502 proxy error

According to this, the charset should be set before calling the $mysqli->real_escape_string('...').

The encoding was missing, which is why real_escape_string was failing.

Simply adding $this->getConnection()->set_charset("utf8"); Solves the problem.