473,394 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Show last modified date from DB in PHP

Is there a way to show in PHP automatic the date when a DB was last
modified?

Jul 17 '05 #1
4 1859
On 2005-07-04, be*****@coaster.ch <be*****@coaster.ch> wrote:
Is there a way to show in PHP automatic the date when a DB was last
modified?


I don't know of any way to get a database to tell you when it was last
modified. You'll probably have to record the modification time manually.

--
Cheers,
- Jacob Atzen
Jul 17 '05 #2
On 4 Jul 2005 04:52:35 -0700, be*****@coaster.ch wrote:
Is there a way to show in PHP automatic the date when a DB was last
modified?


In MySQL, I've accomplished this by adding a timestamp field to the table and
sorting for the most recent value. In this case, it's called recupdated :

$query = "SELECT DATE_FORMAT(recupdated, '%M %e, %Y %l:%i %p') AS datemod ";
$query .= "FROM myTable ";
$query .= "ORDER BY recupdated DESC LIMIT 1;";

Then just echo datemod.

But I'd be curious to find out if anyone else has an alternative ? As a real
kludge, I suppose you could look at the file system modification time on the
..MYD or .MYI file. But that feels very wrong to me . . .

Jul 17 '05 #3
On 4 Jul 2005 04:52:35 -0700, be*****@coaster.ch wrote:
Is there a way to show in PHP automatic the date when a DB was last
modified?


You'll have to define what a "DB" is and what constitutes a modification. The
answer, in general, is no. It might be possible for specific databases. Most of
the time you will have to add datetime fields to the data or tables or whatever
you're monitoring and update them along with the other changes in some way.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #4
On Mon, 04 Jul 2005 04:52:35 -0700, bettina wrote:
Is there a way to show in PHP automatic the date when a DB was last
modified?


Most of the DB varieties usually have auditing facilities.

--
http://www.mgogala.com

Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Amanda | last post by:
Hi, hope you can help me with this one. If I want to get the date a page has been last modified, I can do something like .. document.write("<b>Last updated: "+document.lastModified+"</b>"); ...
11
by: Dennis Marks | last post by:
There seems to be a major program with the automatic display of the last modified date. Using the javascript "document.lastModified" sometimes returns the correct date and sometimes 1 Jan 1970...
7
by: laredotornado | last post by:
Hello, Does anyone know how (or if) I can figure out the last time a web page was last modified if my only access to it is via HTTP (a web browser). Right now, I'm looking at "Page Info" options....
1
by: Svetac | last post by:
Hi, I use a script that shows when the page was last modified. It works fine for just one html file. The thing I would like to do is that the script shows me of last modified file in root...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.