php关于从数据库一个字段里面提取数据的有关问题

WBOY
Release: 2016-06-13 12:02:16
Original
902 people have browsed it

php关于从数据库一个字段里面提取数据的问题

本帖最后由 pengjixin123 于 2014-07-14 14:42:38 编辑 原来我的网站后台有一张表,是从数据库多个字段里面输出字段的。现在数据库结构换了,几个数据全部融合在一个字段里面。现在就要从一个字段里面读取数据出来,这个应该怎么写代码?我把代码贴出来。

以前的代码:有8个字段分别存放数据。

=date("Y-m-d H:i:s",$row['time']);?>
=$row['name'];?>
=$row['url'];?>
=$row['word']?>
=$row['rpage']?>
=$row['ip']?>
?=$row['ip_city'];?>

现在只有一个字段:data,这5个字段的数据全部融合在一个字段里面。请问现在应该怎么写代码输出在前台表格上面?

data字段里面存放的数据类型
a:9:{s:4:"time";i:1405306402;s:4:"name";s:6:"新晨";s:5:"url";s:1:"-";s:4:"word";s:1:"-";s:5:"rpage";s:29:"http://www.baidu.com/test.html";s:5:"cpage";s:1:"-";s:2:"ip";s:15:"117.151.180.150";s:7:"ip_city";s:31:"中国北京市 北京市移动";s:4:"miao";s:1:"5";}
------解决方案--------------------
$row = unserialize($row['data']);
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
Popular Tutorials
More>
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!