M方法sql
//添加數組
$res = M('comment')->add($data); //成功返回新增ID,失敗返回falseapp
//刪除dom
M('myop_myinvite')->where($map)->delete(); //成功返回刪除記錄個數,失敗返回falseui
//保存this
M('user')->where("uid={$this->mid}")->data($data)->save(); //data爲數組,成功返回影響的行數,失敗返回false調試
M('user')->setField('domain',$domain,'uid='.$this->mid); == M('user')->where($map)->setField('email', $_POST['email']) //成功返回影響的行數,失敗返回falseget
//查詢it
$user = M('user')->where('uid='.$this->mid)->field('email,uname')->find(); //單記錄ast
$count = M( 'UserTag' )->where( 'uid='.$this->mid )->count(); //查詢條數
M('comment')->where('`id`='.$_POST['to_id'])->getField('uid'); //按字段查詢
M('WeiboAttach')->where("weibo_type=1")->limit(10)->order("weibo_id DESC")->findAll(); //查詢全部記錄
$res= M('myop_myinvite')->where($map)->order('appid DESC')->findPage('10'); //每頁10條記錄
//原始執行sql語句
$res= M('')->query($sql);
M()->execute($sql);
//調試
dump(M('')->getLastSql());