[Ajuda] Base MYSQL qual a diferenзa
#1

Gente qual a diferenзa entre esses dois aqui:

Read e Write, botei os dois root pq й o unico que eu conheзo devo ta fazendo besteira...

Fica dando esse erro quando inicia o GM deve ser pq eu coloquei os 2 a msm coisa
pawn Код:
[23:22:27] [WARNING] CMySQLHandle::Create - connection already exists
pawn Код:
#define SQL_WRITE 0
#define SQL_READ 1

#define SQL_HOST "localhost"
#define SQL_DB "sampdb"

#define SQL_USER_WRITE "root"
#define SQL_USER_READ "root"

#define SQL_USER_WRITE_PASS ""
#define SQL_USER_READ_PASS ""

new g_Write;
new g_Read;
pawn Код:
forward SQL_DB_CONNECT(database);
public SQL_DB_CONNECT(database)
{
    if(database == SQL_WRITE)
    {
        g_Write = mysql_connect(SQL_HOST, SQL_USER_WRITE, SQL_DB, SQL_USER_WRITE_PASS);
        if(mysql_errno() != 0)
        {
            printf("FAILED CONNECTION TO DATABASE USING %s --- SERVER SHUTTING DOWN ~~~", SQL_USER_WRITE);
            SendRconCommand("exit");
        }
        else
        {
            printf("  SUCCESSFULLY CONNECTED TO DATABASE '%s' WITH USER '%s'", SQL_DB, SQL_USER_WRITE);
        }
    }
    else
    {
        g_Read = mysql_connect(SQL_HOST, SQL_USER_READ, SQL_DB, SQL_USER_READ_PASS);
        if(mysql_errno() != 0)
        {
            printf("FAILED CONNECTION TO DATABASE USING %s --- SERVER SHUTTING DOWN ~~~", SQL_USER_READ);
            SendRconCommand("exit");
        }
        else
        {
            printf("  SUCCESSFULLY CONNECTED TO DATABASE '%s' WITH USER '%s'", SQL_DB, SQL_USER_READ);
            print(" ");
        }
    }
    return 1;
}
Reply


Messages In This Thread
Base MYSQL qual a diferenзa - by maikons - 07.01.2015, 22:09
Re: Base MYSQL qual a diferenзa - by WLSF - 07.01.2015, 22:25
Re: Base MYSQL qual a diferenзa - by PT - 07.01.2015, 22:35
Re: Base MYSQL qual a diferenзa - by maikons - 07.01.2015, 22:38
Re: Base MYSQL qual a diferenзa - by PT - 07.01.2015, 22:46
Re: Base MYSQL qual a diferenзa - by maikons - 07.01.2015, 22:51
Re: Base MYSQL qual a diferenзa - by PT - 07.01.2015, 22:59
Re: Base MYSQL qual a diferenзa - by maikons - 07.01.2015, 23:49

Forum Jump:


Users browsing this thread: 3 Guest(s)