Raised This Month: $2 Target: $400
 0% 

Solved MySql Special Caracters Store Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kratoss1812
Senior Member
Join Date: May 2018
Location: Romānia
Old 06-09-2020 , 14:31   MySql Special Caracters Store Problem
Reply With Quote #1

Hello,

If I store a string that contains a special caracter ( such as ✰⋆🌟✪🔯✨ ) intro a mysql database it will be stored as " ? "
For example " ✰✰ Special String ✰✰ " Will be stored as " ?? SpecialString ?? "

How can I fix that?
__________________

Last edited by kratoss1812; 06-10-2020 at 07:45.
kratoss1812 is offline
NomisCZ
AlliedModders Donor
Join Date: Mar 2014
Location: Czech_Republic
Old 06-09-2020 , 17:09   Re: MySql Special Caracters Store Problem
Reply With Quote #2

Hi,
use utf8mb4 char set and utf8mb4_unicode_ci collation.

https://www.eversql.com/mysql-utf8-v...8-and-utf8mb4/
__________________
NomisCZ is online now
kratoss1812
Senior Member
Join Date: May 2018
Location: Romānia
Old 06-10-2020 , 07:44   Re: MySql Special Caracters Store Problem
Reply With Quote #3

Quote:
Originally Posted by NomisCZ View Post
Hi,
use utf8mb4 char set and utf8mb4_unicode_ci collation.

https://www.eversql.com/mysql-utf8-v...8-and-utf8mb4/
Thank u for your response. Could you give me an exmaple how i could use this in a query? My MySQl knowlege are few.

Edit: I didn't saw the link u atached. Thank u
__________________

Last edited by kratoss1812; 06-10-2020 at 07:45.
kratoss1812 is offline
Cruze
Veteran Member
Join Date: May 2017
Old 06-14-2020 , 13:57   Re: MySql Special Caracters Store Problem
Reply With Quote #4

You can take help from this code: https://github.com/Sples1/ENT_FirstJ...t_firstjoin.sp
__________________
Taking paid private requests! Add me on steam/discord!

AlliedModders Releases | Github | Private Plugins | PayPal | Steam | Discord: Cruze#4947
Cruze is offline
kratoss1812
Senior Member
Join Date: May 2018
Location: Romānia
Old 06-15-2020 , 09:11   Re: MySql Special Caracters Store Problem
Reply With Quote #5

Quote:
Originally Posted by Cruze View Post
neah i got it thanks anyway

here is the code if anyone is having the same issue as me
PHP Code:
        kQuery(g_hDataBase"CREATE TABLE IF NOT EXISTS `tags` (`steamid` varchar(32) PRIMARY KEY NOT NULL, `chat_tag` varchar(128), `tab_tag` varchar(128));""ConnectToDataBase[0]");
        
kQuery(g_hDataBase"ALTER TABLE tags CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;""ConnectToDataBase[3]"); 
__________________
kratoss1812 is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 06-15-2020 , 10:56   Re: MySql Special Caracters Store Problem
Reply With Quote #6

Don't forget to call SQL_SetCharset(g_hDataBase, "utf8mb4"); too!
__________________
Peace-Maker is online now
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:10.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode