Welcome Guest, Not a member yet? Register   Sign In
INSERT DATA in few column

I want inserting data in few column on 1 tabel...how the code in model and controller??? thanks
function register($data){
   $no_akta = $this->input->post('data[no_akta]');
   $tgl_akta = $this->input->post('data[tgl_akta]');
   $notaris_akta = $this->input->post('data[notaris_akta]');
   $data = array(
      'No_Akta_Pendirian_Prsh' => $no_akta ,
      'Tgl_Akta_Pendirian_Prsh' => $tgl_akta ,
      'Notaris_Pem_Akta' => $notaris_akta

function register(){
$form_data = $this->input->post('data');
<form id="form1" name="form1" method="post" action="">
  <table width="322" border="0">
      <td colspan="2">Edit Akta pendirian perusahaan</td>
      <td>No Akta</td>
      <td><label for="data[no_akta]"></label>
      &lt;input type="text" name="data[no_akta]" id="data[no_akta]" /&gt;&lt;/td>
      <td><label for="data[tgl_akta]"></label>
      &lt;input type="text" name="data[tgl_akta]" id="tgl" /&gt;&lt;/td>
      <td><label for="data[notaris_akta]"></label>
      &lt;input type="text" name="data[notaris_akta]" id="data[notaris_akta]" /&gt;&lt;/td>
      <td>&lt;input type="submit" name="button" id="button" value="Simpan" class="buttonedit" /&gt;&lt;/td>

Please post the code you have so far and describe where you got stuck.
Then we can help you to get your code to work.

Don't forget to read the User Guide:

Especially the sections "controllers", "models" and "Database Class"

yeah...my thread was edited...how this solution...???

Thanks for posting the code now.

What happens when you submit the form? Can you describe
what doesn't work - do you get an error message?
And do you have a reason for using "insert_batch" to
insert your form data? Your name attributes look uncommon
too (at least I haven't seen it that way). If you need arrays
as input field names you usually do this:

&lt;input type="text" name="your_name[]" value="" /&gt;

Looking at the code you provided there is no need to use arrays
here. Correct me if I'm wrong.

Theme © iAndrew 2016 - Forum software by © MyBB