[Pawn] [HELP] Invalid string value on MySQL. - Printable Version + open.mp forum (https://forum.open.mp) -- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3) --- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10) --- Thread: [Pawn] [HELP] Invalid string value on MySQL. (/showthread.php?tid=1529) |
[HELP] Invalid string value on MySQL. - Smyle - 2021-01-16 Hey, yall. So i was trying to make some records inside of a MySQL table and i must use special characters (?, ?, ?, ?, etc). The issue is that when i try to insert a new row into the table with that special characters these special characters just returns to me this following error: Code: Incorrect string value: '\xE7\xE3o de...' Note: \xE7 matches to '?' and \xE3 matches to the '?' character. I've already tried to change my collate and character set on MySQL to utfmb4, utf8, latin1, etc. but nothing works. Also i tried to use mysql_escape_string and also tried to use %e instead of %s when manipulating this string whit the special characters. But nothing seems to change. Code: ? ? mysql_format(DBConn, Query, 500, "INSERT INTO %s (Data, Registro) VALUES ('%d', '%s')", tableName, timestamp, msg); Note?: When printing the same format i am using to query, everything shows up fine as expected in the console. RE: [HELP] Invalid string value on MySQL. - Expert* - 2021-01-18 Try using latin1_general_ci in your database. Also set mysql_set_charset( "latin1", db_conn ); in your gamemode. ( this function name and syntax might be different, it depends on mysql version that you are using ) RE: [HELP] Invalid string value on MySQL. - RhaegarX - 2021-01-22 Try using: PHP Code: mysql_set_charset("utf8") |