Please excuse me, but I still don't understand.
Do you want the inventory to be saved everytime when it is changed, instead of just on exiting?
Sorry for my bad english.
So ok, there are 2 ways to create necessary object.
First one:
<img src="http://s1.ipicture.ru/uploads/20111102/zA72Xk5J.png" border="0">
It's inconvenient way, because you need to add every id by yourself every time when you wanna add new object in game.
Second one:
<img src="http://s1.ipicture.ru/uploads/20111102/yzsWVOiT.png" border="0">
This way using database array to detect necessary object and it's even more easier then first
On startup event, i have first way to create objects (where i need to type every id) but i want make it like in second one but I can't do it.
I hope now you understand :<