title: PHP delete from database with codeigniter
body: <p>I want to delete an entry in one table of my database. The table name is <em>book</em>. But in table <em>title</em> use foreign key book.</p>
  
  <pre><code>book: id, name
  title: id, book_id, title
  </code></pre>
  
  <p>Now I want to delete an entry in <em>book</em>. So, I have to delete related entries in <em>title</em> table. My code is :</p>
  
  <pre><code>$this-&gt;db-&gt;where(book_id,$deleteid);
  $this-&gt;db-&gt;delete(title);
  
  $this-&gt;db-&gt;where(id,$deleteid);
  $this-&gt;db-&gt;delete(book);
  </code></pre>
  
  <p>My question is whether the first <em>where clause</em> will affect my second <em>delete clause</em>?
  If it affects the second one, what should I do to avoid this?</p>
  
  <p>Thanks. I am a beginner of PHP.</p>