我在mysql中创建了一个日志表,表名是表名,update\u time update\u time有时间戳。现在我想根据特定的tbl名称选择最长更新时间
<?php
$con=mysqli_connect("localhost","root","","db");
// Check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$mysqltime = $con->query("SELECT Max(update_time ) FROM log_tbls WHERE table_name = 'abc'");
$timestamp = strtotime($mysqltime);
echo date("Y-m-d H:i:s", $timestamp);
?>
我有一个错误strotime()期望参数1是字符串,对象在
1条答案
按热度按时间chhkpiq41#
试试这个