Php 在两个表上使用db前缀的Where子句

Php 在两个表上使用db前缀的Where子句,php,postgresql,codeigniter,activerecord,Php,Postgresql,Codeigniter,Activerecord,我需要编写一个join in where子句形式的查询: $this->db->where('user.client_id','client.id'); //essentially getting those rows of user and client table where the client_id matches $this->db->where('user.id',$id); 另外,我在database.php中使用了db_前缀。这样做的问题是,前缀被添加到

我需要编写一个join in where子句形式的查询:

$this->db->where('user.client_id','client.id'); //essentially getting those rows of user and client table where the client_id matches
$this->db->where('user.id',$id);
另外,我在database.php中使用了
db_前缀。这样做的问题是,前缀被添加到第一个“where”语句的“user”表中,而不是“client”表中


我已恢复使用“join”语句,但是否可以使用“where”语句并同时获取第二个参数的前缀?

“$this->db->set_dbprefix('newprefix');”是否符合您的需要?它表示用于本机sql查询。。我正在使用活动记录。然后检查方法_wh,看看是否可以使用$this->db->where以某种方式解决它,或者您需要重构。(对不起,现在没有时间深入挖掘)