Saving player's inventory in a MySQL database. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Saving player's inventory in a MySQL database. (
/showthread.php?tid=488971)
Saving player's inventory in a MySQL database. -
Shetch - 19.01.2014
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?
Re: Saving player's inventory in a MySQL database. -
Vince - 19.01.2014
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.
Re: Saving player's inventory in a MySQL database. -
Shetch - 20.01.2014
How would I get each player's ID in my users table?
EDIT: Ahh, nevermind, I think I figured it out.
Thanks, man.