Jump to content

List # last edited?


no404

Recommended Posts

well if you have a time/date type column and have it autoupdate every time a row is updated, you can always do like

select * from table order by timecolumn desc limit 30

require vs. include:

from the manual:

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
Unlike include(), require() will always read in the target file, even if the line it's on never executes. If you want to conditionally include a file, use include(). The conditional statement won't affect the require(). However, if the line on which the require() occurs is not executed, neither will any of the code in the target file be executed.
[/quote]
Link to comment
Share on other sites

oh wait, you mean like files. for some reason i saw rows (as in, database table rows) instead of files. silly me.

use [b]scandir[/b] to retrieve an array of the files, then loop through each array element with a [b]foreach[/b] or a [b]while[/b] loop and use [b]filemtime [/b] to get the time modified. Also, inside the loop, make an array of the times, and then sort the array with[b] rsort[/b] to sort them greatest (most recent) to least (oldest) and finally, do a [b]for[/b] loop that counts to 30, echoing the values, or whatever you want to do with them.
Link to comment
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.