When a player transfers an item to their character, the item type is communicated to the server.
In scenarios where a player equips an armband with the type "bracelet," I want it to attempt placing the item ID in the leftbracer column of the game_moblist table (which contains players and adversaries in the game). If the left slot is already occupied by an item ID, then attempt to place it in the right slot. I signify an empty slot with a value of 0.
if (type=="bracelet"){
to_sql="UPDATE game_moblist SET leftbracer"="+item_id+" WHERE id="+player_id
}
Previously, I used a select statement first, but now I prefer doing it all in one query. Thank you.