Note that there are some explanatory texts on larger screens.

plurals
  1. POMySQL Database structure for storing which files and how many times a user downloads?
    primarykey
    data
    text
    <p>I'm creating a database that will store how many times a user downloads a media file, and also what media files a user has downloaded (Based on IP, no login required). I'm just not sure the correct structure for a MySQL database.</p> <p>I already have a database with all the media files, so counting won't be an issue, but I also want to be able to see who downloaded the file. I would be using PHP to retrieve the content, but I'm not sure how to get it most efficiently. So something like: <i>"XYZ.mp3 has 20 downloads. [IMN CMS] <em>Click</em> XYZ.mp3 has been downloaded by 1.2.3.4 four times and sixteen other IPs"</I></p> <p>Also, I would want to be able to see that 1.2.3.4 has listened to XYZ.mp3 four times, and HWM.mp3 one time, and ... etc.</p> <p>Further more, I would eventually like to know how much of the mp3 files they have listened to. (There is a built in player on my site) I also want this to be to where I can see that so many people have listened to so much based on the file, or that this user has listened to this file this much.</p> <p>I know how to do the how many times count, as said before, but I'm not sure how to most efficiently structure the second part so that the data can be quickly gathered.</p> <p>Also, the amount of files grows linearly weekly, and eventually it will become a very large number, so I'm not sure if having 200 columns (right now) that expands as necessary is the way to go? I don't expect a large user base, but you never know. I don't want to have to restructure and recode later because it does.</p> <p>Thanks for the help, let me know if you have any questions.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload