$user=M('user')->table(C('DB_PREFIX').'user as a')->join(C('DB_PREFIX').'role_user as b on a.uid=b.uid')->where('a.uid='.intval($_GET['uid']))->field('a.uid,a.username,a.email,a.mobile,a.password,b.role_id')->find();
个人平时记录的,有点乱 1.修改时间字段,如果时间字段的类型是date或者是datetime类型的 update 表名 set 时间字段 = DATE_FORMAT(NOW(),'%Y-%m-%d %H:%i:%s') where id = 110 2.查询时间格式为date或者datetime类型的数据,用时间做条件的 select * from 表名 where date_format(时间字段,'%Y-%m-%d') = '2016-12-10' 3.替换某个字段中的指定字符或数据 upd