PHP获取mysql数据存储时间。

WBOY
Release: 2016-07-06 13:54:04
Original
1324 people have browsed it

如题,我直接用“date”=>$row可以获取其他数据,但是就是date为空,想问怎么办

回复内容:

如题,我直接用“date”=>$row可以获取其他数据,但是就是date为空,想问怎么办

看看你SQL语句里面的select字段是不是有date 打印出来SQL看看

你的数据库中有没有存储时间,如create_time,update_time等字段。查询出来后,再通过PHP语法转换。而不是“date”=>$row,这个$row代表的更多的是数据库表中的一条数据,你可能要的是"date"=>$row['create_time'].

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!