AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Solved Cant fetch UTF-8 with SQL_FetchString (https://forums.alliedmods.net/showthread.php?t=305293)

midnight9 02-14-2018 14:07

Cant fetch UTF-8 with SQL_FetchString
 
Hello, Im trying fetch players names from database using SQL_FetchString, but it does not work with utf-8 characters, is that normal?

R1KO 02-14-2018 14:53

Re: Cant fetch UTF-8 with SQL_FetchString
 
https://sm.alliedmods.net/new-api/db...ase/SetCharset
Use
PHP Code:

g_hDatabase.SetCharset("utf8"); 

after connecting to the database

midnight9 02-14-2018 15:34

Re: Cant fetch UTF-8 with SQL_FetchString
 
Quote:

Originally Posted by R1KO (Post 2578182)
https://sm.alliedmods.net/new-api/db...ase/SetCharset
Use
PHP Code:

g_hDatabase.SetCharset("utf8"); 

after connecting to the database

Worked, thanks alot!


All times are GMT -4. The time now is 21:41.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.