NomisCZ / hlstatsx-community-edition

HLstatsX Community Edition - PHP 7 and GeoIP2 supported
GNU General Public License v2.0
83 stars 48 forks source link

DBD::mysql::db do failed: Incorrect string value: #74

Closed Gnomesenpai closed 1 year ago

Gnomesenpai commented 2 years ago

Describe the bug Recent logs since the last TF2 update is providing these errors:

DBD::mysql::db do failed: Incorrect string value: '\x97' for column `stats`.`hlstats_Maps_Counts`.`map` at row 1 at .//HLstats.plib line 198.
DBD::mysql::db do failed: Incorrect string value: '\x97' for column `stats`.`hlstats_Maps_Counts`.`map` at row 1 at .//HLstats.plib line 198.
DBD::mysql::db do failed: Incorrect string value: '\x97' for column `stats`.`hlstats_Events_PlayerActions`.`map` at row 30 at .//HLstats.plib line 198.
DBD::mysql::db do failed: Incorrect string value: '\x97' for column `stats`.`hlstats_Maps_Counts`.`map` at row 1 at .//HLstats.plib line 198.
DBD::mysql::st execute failed: Incorrect string value: '\x97' for column `stats`.`hlstats_Servers`.`act_map` at row 1 at .//HLstats.plib line 213.
Unable to execute query (update_server_stats):

                UPDATE
                        hlstats_Servers
                SET
                        name=?,
                        rounds=rounds + ?,
                        kills=kills + ?,
                        suicides=suicides + ?,
                        headshots=headshots + ?,
                        bombs_planted=bombs_planted + ?,
                        bombs_defused=bombs_defused + ?,
                        players=?,
                        ct_wins=ct_wins + ?,
                        ts_wins=ts_wins + ?,
                        act_players=?,
                        max_players=?,
                        act_map=?,
                        map_rounds=?,
                        map_ct_wins=?,
                        map_ts_wins=?,
                        map_started=?,
                        map_changes=map_changes + ?,
                        ct_shots=ct_shots + ?,
                        ct_hits=ct_hits + ?,
                        ts_shots=ts_shots + ?,
                        ts_hits=ts_hits + ?,
                        map_ct_shots=?,
                        map_ct_hits=?,
                        map_ts_shots=?,
                        map_ts_hits=?,
                        last_event=?
                WHERE
                        serverId=?

Incorrect string value: '\x97' for column `stats`.`hlstats_Servers`.`act_map` at row 1 at .//HLstats.plib line 213.

To Reproduce N/A

Expected behavior Not see the above errors

Screenshots N/A

Environment

Additional context Servers do not show the correct maps or name and this also stops updating kills and chat logs

NomisCZ commented 1 year ago

Hello,

please read the installation instructions. MySQL database and tables must support utfmb4 encoding.

MySQL utf8 permits only the Unicode characters that can be represented with 3 bytes in UTF-8. So you need to use utf8mb4 (4 bytes in UTF-8).

Before you create the database it is recommended that you enable utf8mb4 encoding (utf8mb4_unicode_ci). This is because some players may have special characters that utf8 (The default encoding for MySQL) does not support. 👉 https://github.com/NomisCZ/hlstatsx-community-edition/wiki/Installation#-database