Jump to content

Recommended Posts

Hey, im doing a download counter sort of thing.  How can I make the code that adds the data begin after they click the download link.

 

Also, what would be my best option of sotring the data.  just including a php file with an array of all the downloads, then change the variables from there.  A database?

 

Thanks for the help!  ;D

Link to comment
https://forums.phpfreaks.com/topic/45109-link-triggers-code/
Share on other sites

yea, thats what I first thought of doing, but I would prefer not making 217 fields for all of my files.

 

I suppose it would be easier to just make a query then run it through, but still.  That is a lot of fields.

 

if it comes down to is I suppose I can do it.

 

Thanks :)

Link to comment
https://forums.phpfreaks.com/topic/45109-link-triggers-code/#findComment-219197
Share on other sites

well if you want to keep track of how many of each was downloaded, you're going to have to have something unique about each file, be it a name or id or something.  You could setup a table in a database with as little as 2 fields: one called filename and one called amount (or whatever).  whenever the file is downloaded, you would just run a query to update the row where filename = file that was clicked.  You will have 217 rows of data, yes, but that's just a fact of life, and that number will vary, depending on how many files you have.  However, you will still just use those 2 fields (columns) for each one. 

Link to comment
https://forums.phpfreaks.com/topic/45109-link-triggers-code/#findComment-219917
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.