title: Delete Query from codeigniter
body: <p>I'm trying to figure out how I need to do this query. I'm trying to delete all the users who have registered but not activated witin a certain time limit.</p>
  
  <pre><code>function purgeNA($expirePeriod)
  {
      $this-&gt;db-&gt;where('usersStatusesID', 1);
      $this-&gt;db-&gt;where('UNIX_TIMESTAMP(registrationDate) &lt;', time() - $expirePeriod);
      $this-&gt;db-&gt;delete($this-&gt;usersRegistrationsTable);
  }
  </code></pre>
  
  <p>Here's my db structure:</p>
  
  <pre><code>usersRegistrationsTable - userID, registrationDate
  usersTable              - userID, usersStatusesID
  </code></pre>