用php更改最后更新的行的html颜色

时间:2019-03-04 07:47:19

标签: php mysql pdo

在MySQL数据库中更新时,我需要用PHP更改HTML标签颜色的作业。我需要一些提示吗?

2 个答案:

答案 0 :(得分:1)

您可以执行以下步骤: 首先,您必须使用此脚本获取最后的ID:

$last_id = $conn->lastInsertId();

然后您可以通过以下代码在tr中设置颜色:

<?php $data_id = //the id of your data in table ?>
<table>
<tr <?php echo $data_id==$last_id?"style='color:green;'":"" ?>>

祝你好运!

答案 1 :(得分:0)

插入列以保存记录的修改日期“ Modified_Date”

您可以使用以下查询获取上次更新日期

let lineWidth = tableView.bounds.width - 20
let topLine = UIView(frame: CGRect(x: 10, y: 0, width: lineWidth, height: 1))