Saving player's inventory in a MySQL database.
#1

I am making a role-play server in which I will have an inventory for each user. I was wondering how would I save the user's inventory in a MySQL database if I save it as an array on the server? I would make a column for each item, but that would mean that I would have to re-configure the database if I ever want to add an extra item?
Reply
#2

Make more rows! Columns are static, rows are infinite. Create a separate table.

Code:
userid, itemid, amount
You might also want to create a table that holds the items and their descriptions.
Reply
#3

How would I get each player's ID in my users table?

EDIT: Ahh, nevermind, I think I figured it out.
Thanks, man.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)