• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Delete Query from codeigniter

#1
[eluser]xtremer360[/eluser]
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.

Code:
function purgeNA($expirePeriod)
{
    $this->db->where('usersStatusesID', 1);
    $this->db->where('UNIX_TIMESTAMP(registrationDate) <', time() - $expirePeriod);
    $this->db->delete($this->usersRegistrationsTable);
}

Here's my db structure:

Code:
usersRegistrationsTable - userID, registrationDate
usersTable              - userID, usersStatusesID


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.