my phpmyadmin always show me alien text
#1

I set my database and tables collations to utf8_unicode_ci

and added this code in my gamemode

Код:
SQL_Connect() {
    g_iHandle = mysql_connect(SQL_HOSTNAME, SQL_USERNAME, SQL_DATABASE, SQL_PASSWORD);
    if (mysql_errno(g_iHandle) != 0) {
        printf("[SQL] Connection to \"%s\" failed! Please check the connection settings...\a", SQL_HOSTNAME);
    }
    else {
        mysql_query(g_iHandle, "SET NAMES utf8 COLLATE utf8_unicode_ci"); mysql_query(g_iHandle, "set character_set_connection=utf8");
        printf("[SQL] Connection to \"%s\" passed!", SQL_HOSTNAME);
    }
}
but the result was like
Код:
єйТ№аґзЎгЛБи
how can i solve this problem?
Reply
#2

pawn Код:
MySQLConnect()
{
        g_iHandle = mysql_connect(SQL_HOSTNAME, SQL_USERNAME, SQL_DATABASE, SQL_PASSWORD);
       
        switch(mysql_errno(g_iHandle) != 0)
        {
                case 1:
                {
                        printf("Connection to %s database failed. Server is shuting down...", SQL_DATABASE);
                        SendRconCommand("exit");
                }
                case 0: printf("Connection to %s database with %s user, has been established.", SQL_DATABASE, SQL_USERNAME);
        }
        return 1;
}
I recommend you not to set your database and tables collation to utf8_unicode_ci, why you do that? Let it default, on collation default is much better. If you want to explain me why is better with utf8_unicode_ci, PM me.

I made a script for you, to use it, if you want to be easier ( without that unicode thing ).

And, when you make a new database, you can let collation to default, not change it ( https://gyazo.com/59e45b7c1779acb59571c7629bceffb0 ).

I hope I helped you.

+rep if you want, if this thing works?
Reply
#3

I use utf8_unicode_ci because in my server English is not main language.
Reply
#4

This isn't correct:
switch(mysql_errno(g_iHandle) != 0) and the code that the author of the thread shown is correct.
Reply
#5

best topic title ever
Reply
#6

Change utf8_unicode_ci to either utf8_unicode_general or utf8-bin.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)