大神请进—多表关联 多条件查询

浏览:2572 发布日期:2016/07/30 分类:求助交流 关键字: thinkphp俩表俩条件 查询
用户表 //用户类别表
the_comy_rem the_rem_type
字段:ID和the_rem_type 字段:t_r_t_id type name

我是这样写的 但是 只能查询出第一行,
$com=$_SESSION["com"] ; //登录的ID
$compy=M("the_comy_rem"); //用户表

$type=M("the_rem_type"); //用户类别表

$compyrow=$compy->where("ID='$com'")->select();
//查表里the_compyid 等于登录ID
$t_id=$compyrow["the_rem_type"];// the_comy_rem表下the_rem_type字段

$typerow=$type->where("t_r_t_id='$t_id'")->select();

查不出 求大神解决
最佳答案
评论( 相关
后面还有条评论,点击查看>>