#1

Is it possible to connect Windows server with MySQL server if that MySQL server is on Linux?
Reply
#2

Yes, it is, the database's host doesn't prevent the connection with the server.
Reply
#3

DELETED
Reply
#4

Ok, I have a problem...

I made a script for connecting to database and checking if player's account exists in database.
And it doesn't work.

pawn Code:
stock SpojiSeSaBazom()
{
    if(mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_DB, MYSQL_PASS)) print("Spajanje sa MySQL bazom je uspesno!"); // if is succsessful
    else print("Spajanje sa MySQL bazom nije uspelo..."); // if is unsuccessful
}


public OnPlayerConnect(playerid)
{

        new ime[MAX_PLAYER_NAME];
    GetPlayerName(playerid, ime, sizeof ime);  
    new string[64];
    format(string, sizeof(string), "SELECT * FROM Igraci WHERE Ime = '%s'", ime);
    mysql_query(string);
    mysql_store_result();
    if(mysql_num_rows() != 0) SendClientMessage(playerid, 0xFFFFFFFF, "Your account exists in database!");
    else SendClientMessage(playerid, 0xFFFFFFFF, "Your account doesn't exists in database!");
}

I get message "Your account exists in database!" every time, but my account doesn't exists, database is clear.
When I make account, I get "Your account exists in database!" again.
What is the problem? It's my first time to work with MySQL...
Reply
#5

refresh
Reply
#6

Did you check mysql logs?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)