title: Codeigniter Active Record: Inserting empty records into multiple tables based on an id
body: <p>I am using <strong>Codeigniter Active Record Class</strong></p>
  
  <p>I am trying to <strong>create empty records for a particular id in multiple tables</strong>. For example lets say my user has the id <code>$user_id</code>, and I want to <code>create empty records in tables T1, T2 and T3</code>. The code I am having trouble with is:</p>
  
  <pre><code>        // Store the select statement in cache
          $this-&gt;db-&gt;start_cache();
          $this-&gt;db-&gt;set('user_id', $user_id);
          $this-&gt;db-&gt;stop_cache();
          // Insert empty record in tables related to user
          $this-&gt;db-&gt;insert('T1');
          $this-&gt;db-&gt;insert('T2');
          $this-&gt;db-&gt;insert('T3');
          $this-&gt;db-&gt;flush_cache();
  </code></pre>
  
  <p>An empty record is inserted in table <code>T1</code> but then I get the error:</p>
  
  <p><strong>You must use the "set" method to update an entry.</strong></p>
  
  <p><strong>EDIT:</strong> - Obviously, tables <code>T1, T2 &amp; T3</code> have <code>user_id</code> columns.</p>
  
  <p>What am I doing wrong and how can I fix this? I am new to codeigniter and the CI documentation is not clear about this issue.</p>