• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] [HELP] Invalid string value on MySQL.
#1
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);

? ? mysql_query(DBConn, Query);





Note?: When printing the same format i am using to query, everything shows up fine as expected in the console.
  Reply
#2
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 )
  Reply
#3
Try using:



PHP Code:
mysql_set_charset("utf8"
  Reply


Forum Jump: