iStealth
-
Content Count
7 -
Joined
-
Last visited
-
Medals
Posts posted by iStealth
-
-
Ahh, I think I see the error. The _playerLostsResults + 1 that you're trying to do inside the query there is being evaluated as a string literal. You need to use format to create the string first before sending it through the plugin.i thought it was already in the format
_query = [color="#FF0000"]format[/color]["UPDATE player_stats SET playerLosts=(_playerLostsResults + 1) WHERE playerUID = ''%1''", _playerID]; _result = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQLCommand ['dbserver', '%1']", _query];
-
I'm guessing that's an invalid SQL query. Try printing it out before you execute it and run it manually to see if there's an error. Or, check the Arma2NETMySQL log file, there might be additional information and/or the error message in there.10/29/2014 19:32:14 function: Arma2NETMySQLCommand ['dbserver', 'UPDATE player_stats SET playerLosts=(_playerLostsResults + 1) WHERE playerUID = ''myplayeruidhere'''] 10/29/2014 19:32:14 maxResultSize: 10239 10/29/2014 19:32:14 Result size: 13 10/29/2014 19:32:14 Result: [[["Error"]]]
thats all it shows in the logs
-
hello i have found one more problem if anyone can help whats wrong using this code
_playerLosts = format ["SELECT playerLosts FROM `player_stats` WHERE playerUID = ''%1''", _playerID]; _playerLostsResult = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQLCommand ['dbserver', '%1']", _playerLosts]; _playerLostsResult = call compile format["%1", _playerLostsResult]; _playerLostsResults = _playerLostsResult select 0 select 0 select 0; _query = format["UPDATE player_stats SET playerLosts=(_playerLostsResults + 1) WHERE playerUID = ''%1''", _playerID]; _result = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQLCommand ['dbserver', '%1']", _query];
i get the correct data from playerLosts but when i try to update it and + 1 each time they die i get this error
"Log: [[["Error"]]]"
nothing else
-
Perhaps try using "compile" on the result. This should convert it to an array type. https://community.bistudio.com/wiki/compilePerhaps try using "compile" on the result. This should convert it to an array type. https://community.bistudio.com/wiki/compilei tried this and it gives me errors
_playerLosts = format ["SELECT playerLosts FROM `player_stats` WHERE playerUID = ''%1''", _playerID];
_playerLostsResult = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQLCommand ['dbserver', '%1']", _playerLosts];
_playerLostsResult = call compile format["%1", _playerLostsResult];
error i get
diag_log ("Log: " + _playerLostsResult);> 19:19:44 Error position: <+ _playerLostsResult);> 19:19:44 Error Generic error in expression -
After all that do_playerLostsResult = _playerLostsResult select 0 select 0 select 0;
hmmm i get this error
Error in expression playerLostsResult = _playerLostsResult select 0 select 0 select 0;
-
Hello i need some help if anyone can this is my problem i can get the query to work correct but the result is coming out like this [[["15"]]]
i need it too just show 15
this is my code
_playerLosts = format ["SELECT playerLosts FROM `player_stats` WHERE playerUID = ''%1''", _playerID]; _playerLostsResult = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQLCommand ['serverdb', '%1']", _playerLosts];
like i said it results the correct answer but it also shows the brackets but i do not want that.
thanks!
Arma2MySQL
in ARMA 2 & OA : MISSIONS - Editing & Scripting
Posted
ok thanks now i have another problem i hope you can help with
i got it to input info like playerid, name,etc into a the table but if i reconnect it makes another entry how can i make it so if that playeruid already exists into the table to not run the code
this is what i got and it is working
_query = format ["INSERT INTO player_stats (playerUID, playerName, playerWins, playerLosts, playerKills) VALUES('%1', '%2', '0', '0', '0')", _playerID, _playerName]; "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQLCommand ['dbserver', '%1']", _query];