30.07.2016, 23:04
It is actually easier to update it without the use of that include. Your players table should have auto increment enabled and store the player's unique ID somewhere (to global player-array). It is then quite faster to update a row or select data using this ID in WHERE clause. I don't want to confuse you more so I'll just use the example from my post above:
If you wanted to do the above by using that include, you would have to use SQL::Open with type of SQL::READ, store the column's value, use SQL::Close and now open a new one to write to the column with value of the stored variable + 1 and then again close it.
It seems way more complicated, doesn't it? Keep everything else as it is (using the include's functions) but update that specific column with the way I showed you.
pawn Код:
new Query[100];
mysql_format(connection_handle, Query, sizeof Query, "UPDATE "PLAYERS_TABLE" SET TimesKicked=TimesKicked+1 WHERE username='%e' LIMIT 1", GetName(playerid));
mysql_tquery(connection_handle, Query, "", "");
It seems way more complicated, doesn't it? Keep everything else as it is (using the include's functions) but update that specific column with the way I showed you.