Jump to content

getting last update time of mysql table


eon201

Recommended Posts

Hi,

 

I want to get the time/date that a table was last updated within my database.

 

I know you can put a new column in with a timestamp, but the data is old and obviuosly already exists.

 

I notice that in my mysql admin it shows me this time and date. Is there anyway I can grab this and display it in my html page with php??

 

Thanks guys. Eon201

Link to comment
Share on other sites

Your code needs to look something like this:

$result = mysql_query("SHOW TABLE STATUS FROM table_name;");
while($array = mysql_fetch_array($result)) {
print_r($array); // Will print information about each table stored in database
}

 

$result returns a resource. You need to use one of the mysql php functions to use it.

 

BTW, I'm using InnoDB for my tables, and unfortunately it doesn't record a last update time.

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.