SQL replace error
Posted: Fri Feb 27, 2009 6:53 pm
Not sure what this is... checked the code, and the right value appears to be getting passed, but with my SQL in STRICT mode, I am getting an error in SaveItem()
See the "2579"? that is supposed to be a slot... but with tinyint(3), max is 255. So I am not sure where 2579 is coming from anyway. This is logging in the first time on an empty character_items table, pulling 3 items in - bag, food, water.
Code looks fine:
LE, let me save you a lot of time.
LethalEncounter says, "Works on my machine".
Any ideas?
Code: Select all
replace into character_items (id, type, char_id, slot, item_id, creator, condition_, attuned, bag_id, count, max_sell_value, account_id) values
(1127340675, 'NOT-EQUIPPED', 750, 2579, 2528806324, '', 247, 0,1183875888, 132, 3600379438, 150);Code looks fine:
Code: Select all
string update_item = string("replace into character_items (id, type, char_id, slot, item_id, creator, condition_, attuned, bag_id, count, max_sell_value, account_id) values(%lu, '%s', %lu, %i, %lu, '%s', %i, %i, %li, %i, %lu, %lu)");
query.RunQuery2(Q_REPLACE, update_item.c_str(), item->details.unique_id, type, char_id, item->details.slot_id, item->details.item_id,
getSafeEscapeString(item->creator.data.c_str()).c_str(), item->generic_info.condition, item->CheckFlag(ATTUNED) ? 1 : 0, item->details.inv_slot_id, item->details.count, item->GetMaxSellValue(), account_id);
LethalEncounter says, "Works on my machine".
Any ideas?