<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>Show Last updated date</title>
        <link>https://interactivetools.com/forum/forum-posts.php?Show-Last-updated-date-81207</link>
        <description></description>
        <pubDate>Fri, 06 Mar 2026 12:34:54 -0800</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-posts.php?rss=1&amp;Show-Last-updated-date-81207" rel="self" type="application/rss+xml" />

                <item>
          <title>Show Last updated date</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2241653#post2241653</link>
          <description><![CDATA[<p>Hi,</p>
<p>If your database server's operating system is not Windows, you can use this code:</p>
<p><code>$result = mysql_get_query("SELECT UPDATE_TIME, table_name  FROM   information_schema.tables  WHERE  TABLE_SCHEMA = '{database_name}'  ORDER BY UPDATE_TIME DESC");<br /></code></p>
<p>$result is an array with the last updated table's update time stamp and its name. Replace {database_name} with the database your cms is using. And you probably want to add more "WHERE" statements to filter system tables such as _accounts.</p>

<p>If you are using Windows, it only updates "UPDATE_TIME" on insert and delete. Which means if you update a row this "UPDATE_TIME" won't get updated. You will probably need to use this code:</p>
<p><code><br />$tables = ['accounts','products'];  <br />$updatedDateArray = [];  <br />foreach($tables as $tableName){<br />    $resultArray = mysql_get_query('SELECT MAX(updatedDate) AS updatedDate FROM ' . getTableNameWithPrefix($tableName));<br />    $updatedDateArray[$tableName] = $resultArray['updatedDate'];<br />}<br />$lastUpdatedDate = max($updatedDateArray);<br />$lastUpdatedTables = array_keys($updatedDateArray, $lastUpdatedDate);</code></p>
<p>Change $tables to be the tables you want to keep track of. $lastUpdatedDate will be the lasted date an update happened and $lastUpdatedTables will be an array with all tables that have the same lasted updatedDate.</p>

<p>Let me know if you have any questions!</p>
<p>Thanks,</p>]]></description>
          <pubDate>Tue, 16 Jan 2018 12:46:17 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2241653#post2241653</guid>
        </item>
                <item>
          <title>Show Last updated date</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2241644#post2241644</link>
          <description><![CDATA[<p>Thanks Dave</p>
<p>That's got me on the right track, but it's not quite what I was after. Your solution shows me how to display the last time Articles was updated. But let's say I have two tables: Articles and News. How would I display the name and date of the most recently updated table? </p>
<p>For example: if Articles was updated 1 January and News was updated 2nd January, my website would display:</p>
<p>Latest Update: News, 2 January 2018</p>
]]></description>
          <pubDate>Mon, 15 Jan 2018 01:00:04 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2241644#post2241644</guid>
        </item>
                <item>
          <title>Show Last updated date</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2241586#post2241586</link>
          <description><![CDATA[<p>Hi Jeff, </p>
<p>Just saw this old post, if you've still got that task in your queue you can do it with this custom code.  Just change the table name: </p>
<p><code>// get last updated time for a table<br /> $table = getTableNameWithPrefix("<span style="color:#ff0000;">articles</span>");<br /> $firstResult = mysql_get_query("SELECT updatedDate FROM `$table` ORDER BY updatedDate DESC LIMIT 1");<br /> $lastUpdated = $firstResult['updatedDate'];<br /> $lastUpdated = date("Y-m-d H:i:s", strtotime($lastUpdated)); // date formatting: <a href="http://php.net/date" rel="nofollow">http://php.net/date</a><br /> print $lastUpdated;</code></p>
<p>Hope that helps!</p>]]></description>
          <pubDate>Fri, 22 Dec 2017 14:21:22 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2241586#post2241586</guid>
        </item>
                <item>
          <title>Show Last updated date</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2241523#post2241523</link>
          <description><![CDATA[<p>Hi</p>
<p>I have been asked to add a notification to a website that provides the last time the database was updated and what to what section. It would read something like:</p>
<p>[Section Name] last updated: Monday 1 January.</p>
<p>This forum has the function to do this, but I am not using the forum plugin, this is just for a standard cmsb installation.</p>
<p>Thanks</p>


]]></description>
          <pubDate>Thu, 07 Dec 2017 08:29:31 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2241523#post2241523</guid>
        </item>
              </channel>
    </rss>
  