473,226 Members | 1,404 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,226 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 1855
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...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...

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.