변수의 일부를 가져 와서 이것을 where 루프로 실행할 수 있습니까? 14,79,9,85,85,85,85,91,6
이 모든 아이디의를하지만 난이를 실행하려는 경우 문 ID가이 변수 인 경우에만 : 변수의 일부를 얻을 수 있습니까?
function rapport_detail_kosten($idKlant){
$this->db->from('Project');
$this->db->join('Kosten', 'Kosten.idProject = Project.idProject');
if ($idKlant > 0){
$this->db->where('idKlant', $idKlant);}
$query = $this->db->get();
$project = array();
foreach($query->result() as $row){
$project[] = $row->idProject;
}
$hoi = implode(",", $project);
print_r($hoi);
$this->db->select_sum('Prijs');
$this->db->from('Kosten');
$this->db->where('Kosten.idProject',$hoi);
$query = $this->db->get();
if($query->num_rows()>0){
return $query->result();
}
else{
return false;
}
}
$hoi
id=7
시도는/형식 요를 들여 시도도 – senthilbp
그것을 제시하면 위치를 확인하기 위해 실행하기 전에와 in_array 사용 여부를 위 코드가 더 좋고, 배 표준과 같은 표준을 찾아서 따르십시오. –
그래서'$ hoi' = '14, 79,9,85,85,85,85,91,6 '이고'$ idKlant'는 id입니다 . '$ idKlant'가'$ hoi'에 있으면,'where' 문을 실행하십시오. 이게 니가 원하는거야? –