FoolCode/SphinxQL-Query-Builder — pull request #23 by t1gor (2014-09-02 15:53:43+00:00)
Title: 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.