thinkphp join+where

浏览:9746 发布日期:2015/12/02 分类:求助交流 关键字: PHP,Thinkphp
            $m=M('Diary');
            $where['userid']=$_SESSION['userid'];
            $list=$m
            ->join(array('rj_type on rj_type.typeid=rj_diary.typeid '))
            ->where(array('userid'=>$where))
            ->select();
数据库:diary表 :diaryid,userid,typeid,theme,content
type表 :typeid,userid,privary,typename

想通过本两个表匹配typeid,但是需要userid区分查询的用户。怎么写?
最佳答案
评论( 相关
后面还有条评论,点击查看>>