Menu

#81 Users Download Log

Next_Release
open
nobody
None
1
2013-05-16
2013-05-16
Anonymous
No

I wanted to try and let each user see when their file had been downloaded by listing it in the My Files section.

I added a new column in the files table called download, type datetime.

I then tried to workout your code in the file.inc.php serv file section so that after the download was complete, it would update the db. I used the following code which is clearly wrong as it breaks the site. with a server error.

app()->db->update('files',('download' => date('Y-m-d H:i:s') where id = $finfo[$num]['id']))

Could you let me know the correct syntax for this please.

Discussion

  • Alessandro Briosi

    Obviously the syntax is not correct. If you look at the db modules the syntax is
    function update($tbl,$values,$keys = array(),$fields = array())

    Which should translate to:

    app()->db->update('files',array('download'=>date('Y-m-d H:i:s')), array('id'=>$finfo[$num]) );

     
  • Anonymous

    Anonymous - 2013-05-16

    many thanks, i had to use

    app()->db->update('files',array('download'=>date('Y-m-d H:i:s')), array('id'=>$finfo[$num]['id']) );

    :)

    you should fix your DONATE button

     
  • Alessandro Briosi

    yeah sure, my fault :)

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.