So I've got a table that looks like this:
username - item - amount
user1 - sword - 1
user1 - sword - 1
user1 - sword - 1
user2 - sword - 1
user2 - sword - 1
How do I make it so that when I add an item to one of the users, they stack like this instead:
username - item - amount
user1 - sword - 3
user2 - sword - 2
the code for adding item:
$sql = "insert into items (username, item, amount) values ('".$_SESSION['user_name']."', 'sword', '1')";