views:

20

answers:

1

How can I show the last modified date, when my Mysql-database was updated?

(I know there is plugin for showing latest modified date for post/pages, I want to do similar, but show when fields/metadata was updated)

Thankful for answers"

A: 

Ok, solved it.

<?php

global $wpdb;
$result = $wpdb->get_results("SHOW TABLE STATUS FROM database_name LIKE 'table_name';");
foreach ($result as $data) {
    $updatetime = $data->Update_time;
}

$date = substr($updatetime, 0, -3);
echo $date;

?>
Mas Ugn