Problem with INSERT
#1

Hey guys, i have a problem with BlueG (R40) native "mysql_tquery".This function doesn't insert into the database.

Код:
stock OnPlayerBuyFurniture(houseid, interior, world, furnitureslot, model, price, name[], Float:x, Float:y, Float:z)
{
	mysql_format(dbHandle, query, sizeof(query), "INSERT INTO `furnitures` (model, name, houseid, interior, virworld, marketprice, posx, posy, posz) VALUES (%d, '%s', %d, %d, %d, %d, %f, %f, %f)",
	model, name, HouseInfo[houseid][hID], interior, world, price, x, y ,z);
	mysql_tquery(dbHandle, query,"OnFurnitureInsert", "iiiiiis[128]fff", houseid, interior, world, furnitureslot, model, price, name, x, y, z);
	return 1;
}

public OnFurnitureInsert(houseid, interior, world, furnitureslot, model, price, name[], Float:x, Float:y, Float:z)
{
	FurnitureInfo[houseid][furnitureslot][fID] = cache_insert_id();
	FurnitureInfo[houseid][furnitureslot][fHouseID] = houseid;
	FurnitureInfo[houseid][furnitureslot][fInterior] = interior;
	FurnitureInfo[houseid][furnitureslot][fVirtualWorld] = world;
	FurnitureInfo[houseid][furnitureslot][fMarketPrice] = price;
	FurnitureInfo[houseid][furnitureslot][fModel] = model;
	FurnitureInfo[houseid][furnitureslot][fPosX] = x;
	FurnitureInfo[houseid][furnitureslot][fPosY] = y;
	FurnitureInfo[houseid][furnitureslot][fPosZ] = z;
	FurnitureInfo[houseid][furnitureslot][fPosRX] = 0.0;
	FurnitureInfo[houseid][furnitureslot][fPosRY] = 0.0;
	FurnitureInfo[houseid][furnitureslot][fPosRZ] = 0.0;
	format(FurnitureInfo[houseid][furnitureslot][fName], 128, "%s", name);
	FurnitureInfo[houseid][furnitureslot][fOn] = 1;
	return 1;
}
Reply
#2

Is there any errors/warnings in your mysql log?
Reply
#3

No, nothing
Reply
#4

Try this, i removed [128] in the format specifier. As far as i know, you don't need to provide string length for that.
Код:
mysql_tquery(dbHandle, query,"OnFurnitureInsert", "iiiiiisfff", houseid, interior, world, furnitureslot, model, price, name, x, y, z);
Reply
#5

Work. Thanks buddy. +Rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)