473,657 Members | 2,475 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1866
On 2005-07-04, be*****@coaster .ch <be*****@coaste r.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(rec updated, '%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.andyhsoftwa re.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
3228
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>"); Can I use this to display the date that other pages were last modified - eg other pages on my website? I want my index.htm to display the last modified date of other pages on the
11
3627
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 depending the the browser. Using SSI LAST_MODIFIED can return the last modified date, ISP system boot date, or many others. The only last modified date that I have been able to use with any consistancy is the SSI flastmod command.
7
41061
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. There is a "Modified" field but I think that is telling me the time that the file was downloaded to my machine. Any advice is greatly appreciated, - Dave
1
2179
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 directory. For example if I change something in gallery.html or feed.xml, I would like to see that date of change in index.html under last modified date. Could someone help me please. Thanks in advance. The script that I use now:
0
8411
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8838
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8739
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7351
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.