thinkphp遗留问题

时间:2022-06-20 15:12:16

$data = array(
'username' => I('username','','htmlspecialchars'),
'content' => I('content'),
'time' => time()
);

// $result = M('user')->where('id > 1')->delete(); //删除id>1的信息
// var_dump($result);//返回受影响的数目
// replace_phiz($data['content']);

//插入数据库操作
if(M('user')->data($data)->add()){
$data['id'] = $id;
$data['content'] = $data['content'];
//不能显示出表情图片……
$data['time'] = date('y-m-d H:i',$data['time']);
$data['status'] = 1;
$this->ajaxReturn($data,'json');

}else{
$this->ajaxReturn(array('status' => 0),'json');
}

}//END FUNCTION HANDLE()