SA-MP Forums Archive
my phpmyadmin always show me alien text - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: my phpmyadmin always show me alien text (/showthread.php?tid=633963)



my phpmyadmin always show me alien text - hbourne - 10.05.2017

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?


Re: my phpmyadmin always show me alien text - zegareK - 11.05.2017

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?


Re: my phpmyadmin always show me alien text - hbourne - 11.05.2017

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


Re: my phpmyadmin always show me alien text - Logic_ - 11.05.2017

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


Re: my phpmyadmin always show me alien text - Despacito - 11.05.2017

best topic title ever


Re: my phpmyadmin always show me alien text - OscarMike - 11.05.2017

Change utf8_unicode_ci to either utf8_unicode_general or utf8-bin.