2
I’m creating a system in PHP download digital products, I will explain briefly:
- User enters the site, right on the home page, will have some products to download.
- He registers and buys the product.
- The product should be listed for it in the My Downloads in your profile.
My question is, how do I check the downloads that this user has available in my database?
More specifically:
I have the following table called downloads:
ID | NOME | DESCRIÇÃO | VERSÃO
I was thinking of creating a column in the user table, where will list all the download ids that this user has, but is that possible? If not, what would you do?
puts an extra field in the table with the permissible value, e.g.: 1-normal user; 2-vip user, etc. Ai at the time of pulling from the database, just check the user and product/file perm
– Matheus Lopes Marques
But in this way the user would have access to all products, what I need is an individual permission for each product.
– araujoh
save the product id’s and the user id in another table, use the table join in SQL, ai just query by this table and display, type, when the user buys such product, save in the table the id of it, and the product
– Matheus Lopes Marques
That is, I must create a new table "purchases", in this table I must save the user ID and the plugin ID and then I do a foreach on?
– araujoh
but not necessarily need to use the foreach, just consult in the BD, and dps with a while(); tbm da para fazer,
– Matheus Lopes Marques