title: CodeIgniter - Delete data from multiple table
body: <p>I want to delete data from 3 table,i have table <code>user</code>,<code>pemohon</code>,<code>peserta</code> where all table is connected each other with foreign key.</p>
  
  <p>this query work,I've tried on mysql</p>
  
  <pre><code>DELETE user,pemohon,peserta
  FROM user,pemohon,peserta
  WHERE user.id_user=pemohon.id_pemohon AND
  pemohon.id_pemohon=peserta.id_peserta AND pemohon.id_pemohon=1
  </code></pre>
  
  <p>so i convert to CodeIgniter like this</p>
  
  <pre><code>function delete_data($id)
  {
      $this-&gt;db-&gt;where('pemohon.id_pemohon=user.id_user');
      $this-&gt;db-&gt;where('pemohon.id_pemohon=peserta.id_peserta');
      $this-&gt;db-&gt;where('pemohon.id_pemohon',$id);
      $this-&gt;db-&gt;delete('pemohon','user','peserta');
  }
  </code></pre>
  
  <p>but this code not work, can you fix my code? Thanks</p>