I want to know when a particular MySQL table was last updated. How do I form a query to do that? I imagine it has something to do with retrieving the create_time row of the SHOW STATUS table (because I use InnoDB, that I believe is the modified date, believe it or not -- I think it's a bug).
Any ideas?
EDIT: I came up with this PHP code:
[codex]<?php
mysql_connect("localhost","user","password");
$result = mysql_query("SHOW TABLE STATUS FROM db_name LIKE 'tbl_name';");
while($array = mysql_fetch_array($result)) {
echo 'Table: ' . $array[Name] . '<br />
Create Time: ' . $array[Create_time];
}
?> [/codex]So I more or less answered my own question. Weird, though, that Create_time in an InnoDB table appears to actually be the time of modification, not creation. I wonder if that's an acknowledged bug?