Jump to content

Only allow members who have paid w/ tokens to download


mike12255

Recommended Posts

Im creating a token system where if a user uploads notes they get tokens and can download other peoples notes. My problem is I am not sure where to store the information for who has bought the note for future download. Should I store the information in the database under the table that looks after the notes, in its own table, or in a file that has arrays of the Note names and the users who are allowed to download it.

 

I figured the best way would to have it in the db table that looks after the users but im not sure how I would get about making it so that every time the user bought another note I didnt have to add a new field.

Link to comment
Share on other sites

yes I understand that part and actually have it working right now. My issue is say the user loses the note, I want them to be able to visit their profile and redownload and previously purchased notes. However Im not sure how to go about storing the information that they have purchased note X.

Link to comment
Share on other sites

ah... i see.

 

You could have a "users_downloaded" table. Could simply start by having two fields, user ID and downloaded_note.

 

Then if the user downloads the note and loses it, you only have to search the above table and return all the users notes... you could add more info of course like where they got it from date added...etc

____________________

 

 

Otherwise you would have to create a mapping system for each note added:

 

The notes table has userID, noteNumber, note.

 

Then when user '789' downloads note '17' from user '123', you only need to store 17 and 123 instead of the whole note.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.