数据库时间转换
2016-04-09 15:47
316 查看
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>";
}
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>";
}
相关文章推荐
- MySQL命令行登录的例子
- Mysql安全机制
- SQL2008创建订阅报错:使用存储过程sp_dropdistributor,或使用禁用发布和分发向导
- Ubuntu下彻底卸载mysql
- mysqldb 安装
- PL/SQL练习题二(常用函数)
- ubuntu下自动备份mysql数据库
- MySQL相关问题总结
- 整理:数据库设计的六个阶段详解
- mysql常用函数汇总
- MySQL SQL优化
- oracle 汉字 order by方法
- Oracle日期范围查询交叉查询方法
- 初识NoSQL
- MySQL中常用的SQL Mode
- MyBatis批量操作_ORACLE
- mysql explain用法和结果的含义
- MySQL基础 (DML)
- SQLiteDatabase(数据库的增删改查)
- MySQL基础 (DML)