2013-05-20 2 views
0

안녕하세요. codeigniter 및 sheepIt 양식을 복제하고 있습니다. (embed forms).codeigniter의 임베디드 양식에서 데이터를 데이터베이스에 삽입하십시오.

제출 한 데이터를 데이터베이스에 삽입하려고합니다.

출력 데이터 난에서 print_r를 사용했을 때의 형식에()

Array 
(
[project] => Array 
    (
     [0] => Array 
      (
       [module] => Design 
       [features] => Array 
        (
         [feature_0] => Array 
          (
           [feature] => Login 
           [Hours] => 10 
          ) 

         [feature_1] => Array 
          (
           [feature] => Signup 
           [Hours] => 10 
          ) 

        ) 

      ) 

     [1] => Array 
      (
       [module] => Development 
       [features] => Array 
        (
         [feature_0] => Array 
          (
           [feature] => Login 
           [Hours] => 20 
          ) 

        ) 

      ) 

    ) 

[submit] => save 
) 

또한 sheepIt 형태의 코드를 게시 할 수있다.

답변

1

ANSWER :

$arr_data = $this->input->post(); 

foreach($arr_data['project'] as $prj) { 
    foreach($prj as $i) { 
     $arr['module'][] = module = $i['module']; 
     foreach($i['features'] as $f) { 
      $arr['feature'][] = $f['feature']; 
      $arr['Hours'][] = $f['Hours']; 
     } 
    } 
} 
print_r($arr); 

사용 기억 등이 처리의 도착 $ 데이터.

관련 문제