01.06.2014, 10:55
Combine pid and item to make a unique key. Then use only a single query, rather than two:
See also here for a similar structure: https://sampforum.blast.hk/showthread.php?tid=505081
PHP код:
INSERT INTO playerinventory (pid,item,amount) VALUES (%d, %d , %d) ON DUPLICATE KEY UPDATE amount = %d