08.05.2016, 17:50
I was trying to do it, but it wasn't working for some reason, nothing was updating, I remove weaponid as unique and added the field "slot" as unique with the userid, I am not sure how to do it properly:
This is my insert query:
I am entire sure how it should be
EDIT:
This is working I think, is it correct ? :
This is my insert query:
PHP Code:
mysql_format(mysql, query, sizeof(query), "INSERT INTO weapons VALUES (%d, %d, %d, %d) ON DUPLICATE KEY UPDATE Slot=%d", PlayerInfo[playerid][pID], weaponid, ammo, GetWeaponSlot(weaponid), GetWeaponSlot(weaponid));
mysql_tquery(mysql, query, "", "");
EDIT:
This is working I think, is it correct ? :
PHP Code:
mysql_format(mysql, query, sizeof(query), "INSERT INTO weapons VALUES (%d, %d, %d, %d) ON DUPLICATE KEY UPDATE Weaponid=%d, Ammo=%d", PlayerInfo[playerid][pID], weaponid, ammo, GetWeaponSlot(weaponid), weaponid, ammo);
mysql_tquery(mysql, query, "", "")