Please help with our MySQL Error(s)
#1

Hello everyone, so we are fixing a script (Adding to it allot) but the dealership system is totally bugged. Now it is more the saving of the players owned vehicles, so I'll call it that. Now the only thing that isn't working is the saving, the loading works fine but the saving, just will not save and we do not know why.

Here is our SaveVehicle stock...

Код:
stock SaveVehicle(vehicleid)
{
	if(VehicleInfo[vehicleid][carOwned] == 1)
	{
		new tickets[256], weapons[256], drugs[256];
		FormatVehicleTickets(vehicleid, tickets);
		FormatVehicleWeapons(vehicleid, weapons);
		FormatVehicleDrugs(vehicleid, drugs);
		//=====================================================================================
		format(query, sizeof(query), "UPDATE `ownedvehicles` SET `color1` = %d, `color2` = %d, `parkx` = %f, `parky` = %f, `parkz` = %f, `parka` = %f WHERE `owner` = '%s' AND `id` = %d", 
		VehicleInfo[vehicleid][carColor1], 
		VehicleInfo[vehicleid][carColor2], 
		VehicleInfo[vehicleid][carParkX], 
		VehicleInfo[vehicleid][carParkY], 
		VehicleInfo[vehicleid][carParkZ], 
		VehicleInfo[vehicleid][carParkA], 
		VehicleInfo[vehicleid][carOwner], 
		VehicleInfo[vehicleid][carID]);
		mysql_function_query(dbHandle, query, false, "", "");	
		//=====================================================================================
		format(query, sizeof(query), "UPDATE `ownedvehicles` SET `plate` = '%s', `owner` = '%s', `owned` = %d, `broken` = %d WHERE `owner` = '%s' AND `id` = %d", 
		VehicleInfo[vehicleid][carPlate], 
		VehicleInfo[vehicleid][carOwner],
		VehicleInfo[vehicleid][carOwned],
		VehicleInfo[vehicleid][carBroken],
		VehicleInfo[vehicleid][carOwner], 
		VehicleInfo[vehicleid][carID]);
		mysql_function_query(dbHandle, query, false, "", "");
		//=====================================================================================
		format(query, sizeof(query), "UPDATE `ownedvehicles` SET `alarm` = %d, `lock` = %d, `immob` = %d, `insurances` = %d, `destroys` = %d, `gps` = %d, `fuel` = %d, `registered` = %d WHERE `owner` = '%s' AND `id` = %d", 
		VehicleInfo[vehicleid][carAlarm],
		VehicleInfo[vehicleid][carLock],
		VehicleInfo[vehicleid][carImmob],
		VehicleInfo[vehicleid][carInsurances],
		VehicleInfo[vehicleid][carDestroyed],
		VehicleInfo[vehicleid][carGps],
		Gas{vehicleid},
		VehicleInfo[vehicleid][carRegistered],
		VehicleInfo[vehicleid][carOwner],
		VehicleInfo[vehicleid][carID]);
		mysql_function_query(dbHandle, query, false, "", "");
		//=====================================================================================
		format(query, sizeof(query), "UPDATE `ownedvehicles` SET `weapons` = '%s' WHERE `owner` = '%s' AND `id` = %d", 
		weapons,
		VehicleInfo[vehicleid][carOwner],
		VehicleInfo[vehicleid][carID]);
		mysql_function_query(dbHandle, query, false, "", "");
		//=====================================================================================
		format(query, sizeof(query), "UPDATE `ownedvehicles` SET `comp0` = %d, `comp1` = %d, `comp2` = %d, `comp3` = %d, `comp4` = %d, `comp5` = %d, `comp6` = %d WHERE `owner` = '%s' AND `id` = %d", 
		VehicleInfo[vehicleid][carComponent][0],
		VehicleInfo[vehicleid][carComponent][1],
		VehicleInfo[vehicleid][carComponent][2],
		VehicleInfo[vehicleid][carComponent][3],
		VehicleInfo[vehicleid][carComponent][4],
		VehicleInfo[vehicleid][carComponent][5],
		VehicleInfo[vehicleid][carComponent][6],
		VehicleInfo[vehicleid][carOwner],
		VehicleInfo[vehicleid][carID]);
		mysql_function_query(dbHandle, query, false, "", "");
		//=====================================================================================
		format(query, sizeof(query), "UPDATE `ownedvehicles` SET `comp7` = %d, `comp8` = %d, `comp9` = %d, `comp10` = %d, `comp11` = %d, `comp12` = %d, `comp13` = %d, `paintjob` = %d WHERE `owner` = '%s' AND `id` = %d", 
		VehicleInfo[vehicleid][carComponent][7],
		VehicleInfo[vehicleid][carComponent][8],
		VehicleInfo[vehicleid][carComponent][9],
		VehicleInfo[vehicleid][carComponent][10],
		VehicleInfo[vehicleid][carComponent][11],
		VehicleInfo[vehicleid][carComponent][12],
		VehicleInfo[vehicleid][carComponent][13],
		VehicleInfo[vehicleid][carPaintJob],
		VehicleInfo[vehicleid][carOwner],
		VehicleInfo[vehicleid][carID]);
		mysql_function_query(dbHandle, query, false, "", "");
		//=====================================================================================
		format(query, sizeof(query), "UPDATE `ownedvehicles` SET `radio` = %d, `tickets` = '%s', `dupkey` = %d, `comps` = %d WHERE `owner` = '%s' AND `id` = %d", 
		VehicleInfo[vehicleid][carRadio],
		tickets,
		VehicleInfo[vehicleid][carDupKey],
		VehicleInfo[vehicleid][carComps],
		VehicleInfo[vehicleid][carOwner],
		VehicleInfo[vehicleid][carID]);
		mysql_function_query(dbHandle, query, false, "", "");
		//=====================================================================================
		format(query, sizeof(query), "UPDATE `ownedvehicles` SET `drugs` = '%s' WHERE `owner` = '%s' AND `id` = %d", 
		drugs,
		VehicleInfo[vehicleid][carOwner],
		VehicleInfo[vehicleid][carID]);
		mysql_function_query(dbHandle, query, false, "", "");
		//=====================================================================================
		
	}
	return 1;
}
Here is one of the dealership things

Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(_:clickedid != INVALID_TEXT_DRAW)
    {
    	if(clickedid == TextdrawHuntley) // Gives the player a huntley
	    {
    		OwnedVehicle = CreateVehicle(579, 553.6535,-1278.3800,17.2482, 0.0, 0, 0, -1);
			PlayerInfo[playerid][pCarKey] = OwnedVehicle;
			SCM(playerid, COLOR_YELLOW, "Congratulations on your purchase of a Huntley!");
			PutPlayerInVehicle(playerid, OwnedVehicle, 0);
			VehicleInfo[OwnedVehicle][carOwned] = 1;
			SaveVehicle(OwnedVehicle);
     	}
	    else if(clickedid == TextdrawLandstalker) // Gives the player a Landstalker
	    {
	        SetPlayerPos(playerid, -1424.6083, -290.9622, 14.1484);
	        SetPlayerFacingAngle(playerid, 134.9570);
	    }
	    else if(clickedid == TextdrawMesa) // Gives the player a Mesa
	    {
	        SetPlayerPos(playerid, 1688.7990, 1447.7753, 10.7675);
	        SetPlayerFacingAngle(playerid, 267.3902);
	    }

	                     //Hides all the textdraws
	    TextDrawHideForPlayer(playerid, TextdrawOffRoadMenu);
	    TextDrawHideForPlayer(playerid, TextdrawHuntley);
	    TextDrawHideForPlayer(playerid, TextdrawLandstalker);
	    TextDrawHideForPlayer(playerid, TextdrawMesa);
		//TextDrawHideForPlayer(playerid, TextdrawBGOR);
	    CancelSelectTextDraw(playerid);
	}
    return 1;
}
Only the first one for the Huntley has been added as we want to fix the saving first.

Here is one of the errors we are getting...

Код:
[19:07:37] [ERROR] cache_get_row_int - invalid datatype
[19:07:37] [ERROR] cache_get_row_int - invalid datatype
[19:07:37] [ERROR] cache_get_row_int - invalid datatype
[19:07:37] [ERROR] cache_get_row_int - invalid datatype
[19:07:37] [ERROR] cache_get_row_int - invalid datatype
[19:07:37] [ERROR] cache_get_row_int - invalid datatype
[19:07:37] [ERROR] cache_get_row_int - invalid datatype
[19:07:54] [ERROR] cache_get_row_int - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_int - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_int - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_int - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_int - invalid datatype
[19:07:54] [ERROR] cache_get_row_int - invalid datatype
[19:07:54] [ERROR] cache_get_row_int - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_int - invalid datatype
[19:07:54] [ERROR] cache_get_row_int - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_int - invalid datatype
[19:07:54] [ERROR] cache_get_row_int - invalid datatype
[19:07:54] [ERROR] cache_get_row_int - invalid datatype
[19:07:54] [ERROR] cache_get_row_int - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_int - invalid datatype
[19:07:54] [ERROR] cache_get_row_int - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_int - invalid datatype
[19:07:54] [ERROR] cache_get_row_int - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_int - invalid datatype
[19:07:54] [ERROR] cache_get_row_int - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_float - invalid datatype
[19:07:54] [ERROR] cache_get_row_int - invalid datatype
[19:07:54] [ERROR] cache_get_row_int - invalid datatype
[19:07:55] [ERROR] cache_get_row_float - invalid datatype
[19:07:55] [ERROR] cache_get_row_float - invalid datatype
[19:07:55] [ERROR] cache_get_row_float - invalid datatype
[19:07:55] [ERROR] cache_get_row_int - invalid datatype
[19:07:55] [ERROR] cache_get_row_int - invalid datatype
[19:07:55] [ERROR] cache_get_row_int - invalid datatype
[19:07:55] [ERROR] cache_get_row_int - invalid datatype
[19:07:55] [ERROR] cache_get_row_int - invalid datatype
[19:07:55] [ERROR] cache_get_row_int - invalid datatype
[19:07:55] [ERROR] cache_get_row_int - invalid datatype
[19:07:55] [ERROR] cache_get_row_int - invalid datatype
[19:07:55] [ERROR] cache_get_row_int - invalid datatype
[19:07:55] [ERROR] cache_get_row_float - invalid datatype
[19:07:55] [ERROR] cache_get_row_float - invalid datatype
[19:07:55] [ERROR] cache_get_row_float - invalid datatype
[19:07:55] [ERROR] cache_get_row_int - invalid datatype
[19:07:55] [ERROR] cache_get_row_int - invalid datatype
[19:07:55] [ERROR] cache_get_row_int - invalid datatype
[19:07:55] [ERROR] cache_get_row_int - invalid datatype
[19:07:55] [ERROR] cache_get_row_float - invalid datatype
[19:07:55] [ERROR] cache_get_row_float - invalid datatype
[19:07:55] [ERROR] cache_get_row_float - invalid datatype
[19:07:55] [ERROR] cache_get_row_int - invalid datatype
[19:07:55] [ERROR] cache_get_row_int - invalid datatype
[19:07:55] [ERROR] cache_get_row_int - invalid datatype
[19:07:55] [ERROR] cache_get_row_int - invalid datatype
[19:07:55] [ERROR] cache_get_row_int - invalid datatype
[19:07:55] [ERROR] cache_get_row_float - invalid datatype
[19:07:55] [ERROR] cache_get_row_float - invalid datatype
[19:07:55] [ERROR] cache_get_row_float - invalid datatype
[19:07:55] [ERROR] cache_get_row_float - invalid datatype
[19:07:55] [ERROR] cache_get_row_float - invalid datatype
[19:07:55] [ERROR] cache_get_row_float - invalid datatype
[19:07:55] [ERROR] cache_get_row_float - invalid datatype
[19:07:55] [ERROR] cache_get_row_float - invalid datatype
[19:07:55] [ERROR] cache_get_row_float - invalid datatype
[19:07:55] [ERROR] cache_get_row_float - invalid datatype
[19:08:36] [ERROR] cache_get_row_int - invalid datatype
[19:08:36] [ERROR] cache_get_row_int - invalid datatype
[19:08:36] [ERROR] cache_get_row_int - invalid datatype
[19:08:36] [ERROR] cache_get_row_int - invalid datatype
[19:08:36] [ERROR] cache_get_row_int - invalid datatype
[19:08:36] [ERROR] cache_get_row_int - invalid datatype
[19:08:36] [ERROR] cache_get_row_int - invalid datatype
Also a screen shot of the owned vehicles picture.





ANY help at all is so much appreciated!
Reply
#2

Any help is read with care!
Reply
#3

Please use the printf() function to echo your query strings before performing the query and paste them in code tags here.
Reply
#4

Quote:
Originally Posted by SchurmanCQC
Посмотреть сообщение
Please use the printf() function to echo your query strings before performing the query and paste them in code tags here.
I have talked about this with the other developers, could you please explain more about what you mean? We are deeply sorry for not making this easy for you as you are helping use.
Reply
#5

Same problem
Reply
#6

Bump
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)