简体   繁体   English

用PHP检查; 如果连接的动态MySQL数据库已更改?

[英]check, in PHP; if connected dynamic mySQL DB has changed?

I'm wondering if there's any ability from the PHP side ; 我想知道PHP方面是否有任何功能; to detected if the connected mySQL database has changed; 检测所连接的mySQL数据库是否已更改; or updated? 或更新?

I would like to eventually print a time stamp if it was / has. 我希望最终将其打印出来。

So, I have a connection file. 所以,我有一个连接文件。

ie

$host = "BIGHOST:3306";
$user = "root";
$password = "TWIN@*";
$db = "bigDB_db88";

then in other .php files; 然后在其他.php文件中; I call it before queries. 我在查询之前称它为。

ie

require_once('core/include/connection.php');

Context. 上下文。

ie

I'm trying to print a time stamp in a .html file when the connected, dynamic database has changed or updated. 当连接的动态数据库已更改或更新时,我正在尝试在.html文件中打印时间戳 ie ' Last Updated at ' 上次更新时间

Not sure if this is what you are asking... You can try: 不确定这是否是您要的...您可以尝试:

SHOW TABLE STATUS FROM your-db-name;

The query will return Update_time for each table. 查询将为每个表返回Update_time。

You can limit result set (to exclude views or federated tables for example) by adding WHERE clause: 您可以通过添加WHERE子句来限制结果集(例如,排除视图或联合表):

SHOW TABLE STATUS FROM your-db-name WHERE Engine IS NOT NULL AND Update_time IS NOT NULL;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM