print on web page date and time of last MySQL DB update

时间:2019-02-18 00:50:50

标签: php mysql ajax

From what I'm gathering 'information_schema.tables' seems the way to go...

I'm wondering if I can approach this method from the php side; instead of going into mySQL workbench/client.

I'm trying the below; but getting an empty array. Is this possible? I will later simply display a 'Last Updated DD MM YYYY' in a .html page. It seems like this should be possible from my .php file?

It is a dynamic mySQL DB from a windows IIS server.. I have not made any modifications on the mySQL side at this point; only the below attempt. Seems like it should be a easy common task.

 <?php 
    $sql ="SELECT UPDATE_TIME FROM information_schema.tables WHERE 
    TABLE_SCHEMA = 'DB Name' AND TABLE_NAME = 'Table Name"; 
    $tableStatus = mysql_query($sql); 
     while ( 
    $row = mysql_fetch_assoc($tableStatus)) { $fetch[]= $row; echo $fetch;
 } ?>

0 个答案:

没有答案