V
V
Vadim Stepanenko2018-02-17 10:27:12
MySQL
Vadim Stepanenko, 2018-02-17 10:27:12

How to store user items in the database?

Hello! There is a site where users buy, exchange and sell virtual goods. That is, for example, user 1 in the "arsenal" can have a microwave, a cactus, a car. How to store this same arsenal of each user in the database? I am using MySQL

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexander Litvinenko, 2018-02-17
@edli007

the usual one-to-many relationship is a JOIN query to the product table from the user table with a foreign key relationship.

V
Viktor Yanyshev, 2018-02-17
@villiwalla

Tables:
user_items: user_id | item_id | qty
items: id | well, etc.
or
In the user's table, create a json column and store item_id and qty there

B
Barmunk, 2018-02-17
@Barmunk

Will there be a central warehouse? If yes, then use bookkeeping (debit and credit) as with payments and wallet. Store all data in related tables and that's it.

P
Pearlkid, 2012-10-03
@Pearlkid

Signed to the Apple Developer Program for the second year. As far as I know, payment by card is only possible for a small number of countries: US, UK, etc. I live in Russia and had to hand-write the form and fax/e-mail them to them.
email: [email protected]
fax: +1 (408) 862-7602
The form is available here .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question