This really is my php code (I curently have an association towards the db):

$result = mysql_query("SHOW TABLE STATUS FROM mydb LIKE 'mytable';");
     while ($array = mysql_fetch_array($result)) {
          $updatetime = $array['Update_time'];
     }

echo $updatetime;

I recieve:

Warning: mysql_fetch_array(): provided argument isn't a valid MySQL result resource.

I'm running MySQL 5..89 and PHP5.

I don't want to include a brand new area towards the table... I wish to make use of the table status...

Any help?

Thanks!

Warning: mysql_fetch_array(): provided argument isn't a valid MySQL result resource.

You didn't give you the right resource to mysql_fetch_array. Also, In my opinion you've your $array and $result variables confused, and note the my_database reference which I'll explain below.

$array = mysql_query("SHOW TABLE STATUS FROM my_database;"); <--here
     while ($array = mysql_fetch_array($result)) { <--$result is undefined.

Ought to be rather

$result = mysql_query("SHOW TABLE STATUS FROM my_database;");
     while ($array = mysql_fetch_array($result)) {
          $updatetime = $array['Update_time'];
     }

echo $updatetime;

By now, your MySQL syntax isn't correct when it comes to [cde] you have to reference your database after your SHOW TABLE STATUS clause.

The show table status from ought to be then database title not table title:

FROM

Also any time you perform query, it is best to check its return value before you decide to proceed and begin while using result object.

SHOW TABLE STATUS FROM <DATABASE NAME>

Table update time should be obtained from table area only.

Figured it. Unsure if the is a fantastic way, however it works...

$res= mysql_query("SHOW TABLE STATUS FROM DB;");
if(! $res) {
 die('Query failed'.mysql_error());
}

After that you can parse the raw timestamp with substr.

P.S. When I was carrying this out for Wordpress, I'm such as the code particularly for employed in the Wordpress DB...

$result = mysql_query("SHOW TABLE STATUS FROM mydb LIKE 'mytable';");
foreach ($result as $data) {
    $updatetime = $data->Update_time;
}

echo $updatetime;