Set_charset MYSQLI Commands out of sync?

There is such code, when I set the object encoding with charset set, then for any other query throws out the error "Commands out of sync". If you remove set the charset, it works, how to overcome the error?
$db = Database::getInstance();
$mysqli = $db->getConnection();
$last_date = undef;
if ($stmt = $mysqli->prepare('select max(`date`) from `average_temp`)) {
July 9th 19 at 10:12
1 answer
July 9th 19 at 10:14

Find more questions by tags MySQLPHP