Re: Displaying the time of the Latest Update to an ISAM table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





boclair wrote:

PHP 4.3.10
MySql 4.0.20

How do I find and then display on a web page the time that additional data added to, or, existing data amended in an ISAM table?

My latest futile attempt , with connection made and the database already selected,

<?PHP
$logged = mysql_query("SHOW TABLE STATUS UPDATE_TIME FROM  members");
if (!$logged) {$logged="not found";}
else {$logged=$logged;}
?>
<p>Last logged: <?PHP =$logged;?></p>

With no errors reported, the display is "not found".


I believe this syntax is wrong.

With a database, workshop3,  and datatable,  jobs, should it have read


<?PHP
$logged = mysql_query("SHOW TABLE STATUS UPDATE_TIME FROM workshop3 LIKE 'jobs'");
if (!$logged) {$logged="not found";}
else {$logged=$logged;}
?>
<p>Last logged: <?PHP =$logged;?></p>


but $logged is false. Is my syntax still wrong or cannot the last date modified not be got this way

But using the SHOW TABLE STATUS array was successful.
<?PHP
$query = mysql_fetch_array(mysql_query("SHOW TABLE STATUS FROM workshop3 LIKE 'jobs'"));
$lastmod = $query['Update_time'];
?>
<p>Last updated <?PHP = $lastmod; ?></p>


Am I correct in assuming that working with the SHOW TABLE STATUS array is more efficient than finding the MAX timestamp inserted/replaced for the purpose into each ROW?

Louise

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux