title: insert data in corresponding tables from multistep form
body: <p>I have a multistep form which is called "card"</p>
  
  <p>This form must contain sevral information of a person, what person has done, the job of person, tools person used etc.</p>
  
  <p>To solve this and make it more cool I made a multiform step form, so when user finishes filling data for first table (for instace the information of tools he used) user clicks on next step button and then inputs from other table is showed (project person has worked)... this keeps on going till user fills all necessary data. To save work I am using grocerycrud.</p>
  
  <pre><code>&lt;form method="post" action="&lt;?php echo base_url();?&gt;controller/save" name="form"/&gt;
    &lt;label&gt;User Name&lt;/label&gt;
    &lt;input type="text" name="Username"&gt;   
    &lt;input type="submit" value="Add"/&gt;
    &lt;!--#######################
         Several more data to store in distict tables
     #######################
     --&gt;    
  &lt;/form&gt;   
  
  
  in controller:
  
    function save
      {
        $arrData["Username"] = $this-&gt;input-&gt;post("Username");
        $this-&gt;User_model-&gt;Add($arrData); 
      } 
  
  
  in User_model
  
  function Add($arrData) { 
          if($this-&gt;db-&gt;insert(tableName, $arrData))
            return true;
          else
            return false;
      } 
  </code></pre>
  
  <p>When redirecting to controller everything would work if I fill only one table.</p>
  
  <p>The problem is I do not know how to store corresponding data to other tables involved.
  So if I insert a new registry in <strong>tableName</strong> a new ID is assigned. Now I would liket to use this recently assigned ID to use it as other requiered field in other tables (the related tables have this ID as foreign key)</p>
  
  <p>How to solve this is there something like:</p>
  
  <pre><code>$last_id = $user-&gt;id;
  </code></pre>
  
  <p>so I keep inserting data into other tables, </p>
  
  <p>will it be useful to use </p>
  
  <pre><code>$crud-&gt;set_relation('column','table','column');
  </code></pre>
  
  <p>maybe a callbackor something, Has anyone have done something like inserting into multiple related tables from one form?</p>