Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9065715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:34:29+00:00 2026-06-16T16:34:29+00:00

I’m creating a database that will store how many times a user downloads a

  • 0

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.

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: “XYZ.mp3 has 20 downloads. [IMN CMS] Click XYZ.mp3 has been downloaded by 1.2.3.4 four times and sixteen other IPs”

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.

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.

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.

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.

Thanks for the help, let me know if you have any questions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T16:34:30+00:00Added an answer on June 16, 2026 at 4:34 pm

    If it were me I’d have 3 tables:

    1. connections – keep IP and session id with some unique connection id.
    2. downloads – keep file id, and connection id. This lets you know how many times a file has been downloaded and by which connection.
    3. plays – keep file id, connection id and file dl %. Use http partial content to track how much of each file has been played by a given connection id.

    Between these three you can build stats for what you’re asking for.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I've got a string that has curly quotes in it. I'd like to replace
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I need a function that will clean a strings' special characters. I do NOT
I have a reasonable size flat file database of text documents mostly saved in
Let's say I'm outputting a post title and in our database, it's Hello Y’all
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.