码迷,mamicode.com
首页 > 数据库 > 详细

数据库时间转换

时间:2016-04-09 16:47:18      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:

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>";
}

数据库时间转换

标签:

原文地址:http://www.cnblogs.com/llforeverlove/p/5371786.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!