MySQL don't connect
#1

I changed mysql and put MySQL R5 by g-style, the idea is that does not connect to WAMP server.

function connect :

pawn Код:
public ConnectMySQL(sqlhost[], sqluser[], sqldb[], sqlpass[])
{
    print("MySQL: Connect to the server.");
    mysql_connect(sqlhost, sqluser, sqldb, sqlpass);
    if(mysql_ping()==0)
    {
        print("MySQL: Database connection established.");
        return 1;
    }
    else
    {
        print("MySQL: Connection error, retrying...");
        mysql_connect(sqlhost, sqluser, sqldb, sqlpass);
        if(mysql_ping()==0)
        {
            print("MySQL: Reconnection successful. We can continue as normal.");
            return 1;
        }
    }
    return 1;
}
and gives me the message:

MySQL: Connection error, retrying...
Reply
#2

Quote:
Originally Posted by exDDDD
Посмотреть сообщение
I changed mysql and put MySQL R5 by g-style, the idea is that does not connect to WAMP server.

function connect :

pawn Код:
public ConnectMySQL(sqlhost[], sqluser[], sqldb[], sqlpass[])
{
    print("MySQL: Connect to the server.");
    mysql_connect(sqlhost, sqluser, sqldb, sqlpass);
    if(mysql_ping()==0)
    {
        print("MySQL: Database connection established.");
        return 1;
    }
    else
    {
        print("MySQL: Connection error, retrying...");
        mysql_connect(sqlhost, sqluser, sqldb, sqlpass);
        if(mysql_ping()==0)
        {
            print("MySQL: Reconnection successful. We can continue as normal.");
            return 1;
        }
    }
    return 1;
}
MySQL: Connection error, retrying...
What if you try printing this after mysql_connect:
printf("Ping: %i",mysql_ping());
just curious what it prints
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)