는이 코드가 폭발에서 insert_batch :CodeIgniter의 및
function insertGenre() {
$genres = explode(',',$this->input->post('genreName'));
foreach($genres as $genre) {
$temp = array(
'id' => null,
'name' => $genre,
'popular' => '0'
);
$data2[] = $temp;
}
return $data2;
$data = array(
'id' => null,
'name' => $this->input->post('genreName'),
'popular' => '0'
);
//$this->db->insert('genres',$data);
$this->db->insert_batch('genres',$data2);
}
그냥 잘 실행한다 (나는 여기에 몇 가지 질문을 통해 실행)을하지만 그렇지 않습니다. 내가 도대체 뭘 잘못하고있는 겁니까?
어떻게해야할까요? 출력으로 무엇을 기대합니까? 실제로 무엇을합니까? [무엇을 시도 했습니까?] (http://www.whathaveyoutried.com/)? – Matt
또한 ** 당신의 함수가'$ data2'를'반환 '하고 그 아래의 줄을 결코 실행하지 않는다는 것을 ** 당신은 인식합니까? – Matt
['return'] (http://php.net/manual/en/function.return.php)의 기능을 새로 고침하십시오. (그것은 링크입니다, BTW). – Matt