SA-MP Forums Archive
MySQL Query - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL Query (/showthread.php?tid=624426)



MySQL Query - GoldenLion - 16.12.2016

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)


Re: MySQL Query - Runn3R - 16.12.2016



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


Re: MySQL Query - GoldenLion - 16.12.2016

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.


Re: MySQL Query - Runn3R - 16.12.2016

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.


Re: MySQL Query - GoldenLion - 16.12.2016

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.