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
https://forums.phpfreaks.com/topic/77641-getting-last-update-time-of-mysql-table/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.