Get the update timestamp of MySQL table

To get the timestamp when a table in MySQL is updated:

$sql = "SHOW TABLE STATUS WHERE name = 'table_name'";
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
$update_timestamp = $row['Update_time'];
$update_time = strtotime($update_timestamp);

Leave a Reply