当前位置:Gxlcms > 数据库问题 > 数据库时间转换

数据库时间转换

时间:2021-07-01 10:21:17 帮助过:2人阅读

public function index(){
include("connect.php");
$sql="select * from msg1";
echo "<h3>用户列表:</h3>";
echo ‘<table border="1" width="80%">‘;
$results=mysql_query($sql);
while($user=mysql_fetch_array($results))
{
$time=$user[‘time‘];
echo "<tr>";
echo "<td>{$user[‘Id‘]}</td>";
echo "<td>{$user[‘username‘]}</td>";
echo "<td>{$user[‘content‘]}</td>";
echo "<td>".date("Y-m-d h:i:s",$user[‘time‘])."</td>";
echo ‘<td><a href="">查看</a></td>‘;
echo "</tr>";
}
echo "</table>";
}

数据库时间转换

标签:

人气教程排行