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

From: Date: Mon, 21 Feb 2005 07:11:53 +0000
Subject: Re: Displaying the time of the Latest Update to an ISAM table
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-38624@lists.php.net to get a copy of this message
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

« previous php.db (#38624) next »