PDA

View Full Version : SQL error issue


TwinkiDaBoss
28/07/2015, 09:30 PM
Alright so preety much I just noticed, Im having this issue

cache_get_field_content_int - invalid datatype


new query[1024] = "UPDATE `players` SET `Admin`=%d, `VIP`=%d, `Reputation`=%d, `posX`=%f, `posY`=%f, `posZ`=%f, `Score`=%d, `Deaths`=%d, `Kills`=%d, `Banned`=%d, `Kicks`=%d";
strcat(query,", `EquipmentM4`=%d,`EquipmentAK47`=%d,`EquipmentDeag le`=%d,`EquipmentKnife`=%d,`Equipment9MM`=%d,`Equi pmentShotgun`=%d,`EquipmentUzi`=%d,`EquipmentSilen ced`=%d, \
`EquipmentRifle`=%d,`EquipmentScope`=%d,`Equipment Tec9`=%d,`EquipmentRocketLauncher`=%d,`PersonalMis sion`=%d,`PlayerVehicle`=%d,`PlayerVehiclePrice`=% d,`PlayerVehicleColor1`=%d,`PlayerVehicleColor2`=% d, \
`PlayerVehicleNitro`=%d,`PlayerVehicleRims`=%d,`Pl ayerModsPrice`=%d,`VIPDays`=%d,`VIPSet`=%d,`SubCla ss`=%d WHERE `ID`=%d");

format(query, sizeof(query), query,pInfo[playerid][Admin], pInfo[playerid][VIP], pInfo[playerid][Reputation], pos[0], pos[1], pos[2], pInfo[playerid][Score],pInfo[playerid][Deaths],
pInfo[playerid][Kills],pInfo[playerid][Banned],pInfo[playerid][Kicks],pInfo[playerid][EquipmentM4],pInfo[playerid][EquipmentAK47],
pInfo[playerid][EquipmentDeagle],pInfo[playerid][EquipmentKnife],pInfo[playerid][Equipment9MM],pInfo[playerid][EquipmentShotgun],pInfo[playerid][EquipmentUzi],
pInfo[playerid][EquipmentSilenced],pInfo[playerid][EquipmentRifle],pInfo[playerid][EquipmentScope],pInfo[playerid][EquipmentTec9],pInfo[playerid][EquipmentRocketLauncher],pInfo[playerid][PersonalMission],
pInfo[playerid][PlayerVehicle],pInfo[playerid][PlayerVehiclePrice],pInfo[playerid][PlayerVehicleColor1],pInfo[playerid][PlayerVehicleColor2],
pInfo[playerid][PlayerVehicleNitro], pInfo[playerid][PlayerVehicleRims],pInfo[playerid][PlayerModsPrice],pInfo[playerid][VIPDays],pInfo[playerid][VIPSet],pInfo[playerid][SubClass],pInfo[playerid][ID]);


It starts of at pInfo[playerid][Deaths] and ends at the last line

Vince
28/07/2015, 09:31 PM
Why are you trying to get a result from an update query?

TwinkiDaBoss
28/07/2015, 09:34 PM
What do you mean? I use this to save player data


EDIT: Could this cause the problem then I assume? I get your point

pInfo[playerid][Admin] = cache_get_field_content_int(0, "Admin");
pInfo[playerid][VIP] = cache_get_field_content_int(0, "VIP");
pInfo[playerid][Reputation] = cache_get_field_content_int(0, "Reputation");
pInfo[playerid][posX] = cache_get_field_content_float(0, "PosX");
pInfo[playerid][posY] = cache_get_field_content_float(0, "PosY");
pInfo[playerid][posZ] = cache_get_field_content_float(0, "PosZ");
pInfo[playerid][Score] = cache_get_field_content_int(0, "Score");
pInfo[playerid][Deaths] = cache_get_field_content_int(0, "Deaths");
pInfo[playerid][Kills] = cache_get_field_content_int(0, "Kills");
pInfo[playerid][Kicks] = cache_get_field_content_int(0, "Kicks");
pInfo[playerid][Banned] = cache_get_field_content_int(0, "Banned");

pInfo[playerid][EquipmentM4] = cache_get_field_content_int(0, "EquipmentM4");
pInfo[playerid][EquipmentAK47] = cache_get_field_content_int(0, "EquipmentAK47");
pInfo[playerid][EquipmentDeagle] = cache_get_field_content_int(0, "EquipmentDeagle");
pInfo[playerid][EquipmentKnife] = cache_get_field_content_int(0, "EquipmentKnife");
pInfo[playerid][Equipment9MM] = cache_get_field_content_int(0, "Equipment9MM");
pInfo[playerid][EquipmentShotgun] = cache_get_field_content_int(0, "EquipmentShotgun");
pInfo[playerid][EquipmentUzi] = cache_get_field_content_int(0, "EquipmentUzi");
pInfo[playerid][EquipmentSilenced] = cache_get_field_content_int(0, "EquipmentSilenced");
pInfo[playerid][EquipmentRifle] = cache_get_field_content_int(0, "EquipmentRifle");
pInfo[playerid][EquipmentScope] = cache_get_field_content_int(0, "EquipmentScope");
pInfo[playerid][EquipmentTec9] = cache_get_field_content_int(0, "EquipmentTec9");
pInfo[playerid][EquipmentRocketLauncher] = cache_get_field_content_int(0, "EquipmentRocketLauncher");

pInfo[playerid][PersonalMission] = cache_get_field_content_int(0, "PersonalMission");
pInfo[playerid][PlayerVehicle] = cache_get_field_content_int(0, "PlayerVehicle");
pInfo[playerid][PlayerVehiclePrice] = cache_get_field_content_int(0, "PlayerVehiclePrice");
pInfo[playerid][PlayerVehicleColor1] = cache_get_field_content_int(0, "PlayerVehicleColor1");
pInfo[playerid][PlayerVehicleColor2] = cache_get_field_content_int(0, "PlayerVehicleColor2");
pInfo[playerid][PlayerVehicleNitro] = cache_get_field_content_int(0, "PlayerVehicleNitro");
pInfo[playerid][PlayerVehicleRims] = cache_get_field_content_int(0, "PlayerVehicleRims");
pInfo[playerid][PlayerModsPrice] = cache_get_field_content_int(0,"PlayerModsPrice");
pInfo[playerid][VIPDays] = cache_get_field_content_int(0,"VIPDays");
pInfo[playerid][VIPSet] = cache_get_field_content_int(0,"VIPSet");
pInfo[playerid][SubClass] = cache_get_field_content_int(0,"SubClass");

TwinkiDaBoss
28/07/2015, 09:54 PM
Im also reading SQL log now and Im getting this too
[22:54:48] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `players` SET `Admin`=5, `VIP`=3, `Reputation`=200510, `p", callback: "(null)", format: "(null)"


EDIT: The issue is that it prints out bullshit into the SQL log BUT it saves all the data properly, erm what to do lmfao


EDIT 2: Just to say something, the first issues on the main post is fixed.