MySQL Query
#1

Hi, why isn't that query below working?
Код:
new query[300];

mysql_format(g_MySQL, query, sizeof(query), "INSERT INTO `accounts` (`Name`, `Password`, `Salt`, `Email`, `IP`, `LastLogin`) VALUES ('%s', '%s', '%s', '%s', '%s', '%s')", GetName(playerid), PlayerInfo[playerid][pPassword], PlayerInfo[playerid][pSalt], PlayerInfo[playerid][pEmail], PlayerInfo[playerid][pIP], PlayerInfo[playerid][pLastLogin]);
mysql_tquery(g_MySQL, query, "OnQueryFinished", "dd", playerid, QUERY_CREATE_ACCOUNT);
I don't see anything wrong in the code, but it doesn't create a row and it creates a huge log: http://pastebin.com/MyL6GgRu (that's some messy stuff and I can't even find anything about the insert query there)
Reply
#2



Did you adjust your id to auto_increment? And it needs to be unsigned too.
Reply
#3

That's account saving. The problem is that it doesn't even create a row so I can't get the ID and yes I have AUTO INCREMENT.
Reply
#4

I know but it was weird that's why i posted it.

Rename the log and register a new account then post the new log hence there is no 'Insert' in the logs. Either your script doesn't even come up to that part(Insert) or you've messed up the query.

I would suggest posting the server logs too if you have crashdetect.
Reply
#5

That's what I did. I deleted the o ld log and created a new account to create a new log. The server logs are OK as well and it does get to that part because it works how it's supposed to, but it just doesn't create a row.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)