Sunday, 15 February 2015

mysql - Updating a database info when a file is updated in PHP -


I have a database (MySQL) table that stores a link to downloadable files and the last time in this The files included were also updated

To update the files in the file manager in cPanel to run the code, I would like to change the time values ​​(timestamp) in the database table.

How can I do this in Php? I tried to search, but to no avail it requires some guidance.

What I have done so far is to create an interface so that I can insert files into the database using SB Admin v2.0. It takes care to update the time-level, however, I do not need the interface because I will run the code to update the files.

So what I see is how to get the last modified time of the file using PHP?

If you want to "listen" to files, update filesystem via external script (not PHP) To do this, use the cron job to run this (pseudo) code.

  $ arrays ('file1.txt' => Timestamp '= & gt;' 12346879 '),); $ Target = '/ upload'; $ Weeds = array ('.', '..'); $ Uploadfile = array_diff (scanner ($ target), weaver $); ($ Files [$ filename])) {if $ $ [$ filename] ['timestamp']  parameter, array (': filename' = & gt; $ filename, ': timestamp' = & gt; $ files [$ filename] ['timestamp'])); }} And {$ db- & gt; Insert (getFileInfo ($ filename)); }}  

No comments:

Post a Comment