时间:2021-07-01 10:21:17 帮助过:6人阅读
select("select info from personal_info"); $dat=array(); foreach($data as $v) { $tmp=unserialize($v['info']); $tmp[2]=$tmp[2]=="0"?"男":"女"; $dat[]=$tmp; } $this->assign('data',$dat); $this->display("index.html"); } public function Adds(){ $arr[]=$_POST['per_name']; $arr[]=$_POST['per_age']; $arr[]=$_POST['per_sex']; $data['info']=serialize($arr); $this->add($data,"personal_info"); $this->redirect("Index/index"); } } ?>
welcome YouYaX
姓名 年龄 性别
{data.0} {data.1} {data.2}