Jump to content

[SOLVED] Updating downloaded by field


dennismonsewicz

Recommended Posts

Eh, you question is confusing me, so this may not be the answer you want..

 

I'm assuming you are trying to input the info into a DB?

If you have set up a DB table 'downloads' for example. Just have it input the username and no other info. If it's a DB it won't overwrite anything.

 

 

Ok,

 

Let me try to explain this a little better.

 

I am wanting to track which image a user downloads. I have a downloaded_by field in my DB. Is there anyway to update this field with the username and have it just add the username on everytime that image is downloaded?

 

For example:

 

downloaded_by: dennis, john, susie...

 

Instead of overwriting this field everytime

when the user clicks to DL the image, route their session username to the 'downloaded_by' table, and have a timestamp or id value so you can properly organize which values should be output, and use the timestamp to output

 

ORDER by DESC, LIMIT 0, 1

 

look up a little about SQL, ordering, DESC, LIMIT, etc..

 

From what your asking, that is the most effective method, and it only requires 2 DB tables, and it will never fail you.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.