データをユーザー入力に一致させるために、結合の後に where 句を指定することは可能ですか? たとえば、次のコードがあるとします。
$this->db->select('user.*,role.*')
$this->db->from('user');
$this->db->where('user.username', $username);
$this->db->where('user.password', $password);
$this->db->join('role','role.id = user.role_id')
$result = $this->db->get();
テーブル「ロール」から一致するデータをクエリしたい:
$this->db->select('user.*,role.*')
$this->db->from('user');
$this->db->where('user.username', $username);
$this->db->where('user.password', $password);
$this->db->join('role','role.id = user.role_id')
$this->db->where('role.speaker', $speaker); //want to know if this is correct
$result = $this->db->get();
これは可能ですか?JOIN の後で (WHERE を使用して) 結果を比較できますか? WHERE 句に一致する結果が生成されますか?
ありがとう!