MySQL saving IP problem
#1

thx for the help
Reply
#2

Add this to see more detailed info on the error.

pawn Код:
public OnQueryError(errorid, error[], callback[], query[], connectionHandle)
{
    print(error);
    return 1;
}
EDIT: Change this too, no need to escape single quotes.
pawn Код:
(\'%s\', \'%s\', \'%s\', \'%s\')
To
pawn Код:
('%s', '%s', '%s', '%s')
That's probably the error.
Reply
#3

Oh thanks, Now the error is
Reply
#4

Looks like your array isn't big enough for the query.

pawn Код:
stock CheckAccount(playerid)
{
    new query[100];//not exact but definatly big enough
    format(query, sizeof(query), "SELECT ID, Password, Salt, Admin FROM `accounts` WHERE `Name` = '%s' LIMIT 1", Name(playerid));
    mysql_function_query(g_Handle, query, true, "OnAccountCheck", "d", playerid);
    return 1;
}
Reply
#5

Lol, thanks alot! I'm a beginner in MySQL I thought it was more than that. It's now saving the ip. but If I need to add more variables, I'll need to always make bigger arrays? Because I have about 50 variables to store.. I'll need a n array of 5000 lol.
Reply
#6

Quote:
Originally Posted by andrew2695
Посмотреть сообщение
Lol, thanks alot! I'm a beginner in MySQL I thought it was more than that. It's now saving the ip. but If I need to add more variables, I'll need to always make bigger arrays? Because I have about 50 variables to store.. I'll need a n array of 5000 lol.
Why would you select all variables when the player needs to login.. you load them after he puts the right password..
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)