CodeIgniter Forums
Delete Query from codeigniter - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Delete Query from codeigniter (/thread-52292.html)

Delete Query from codeigniter - El Forum - 06-05-2012

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.

function purgeNA($expirePeriod)
    $this->db->where('usersStatusesID', 1);
    $this->db->where('UNIX_TIMESTAMP(registrationDate) <', time() - $expirePeriod);

Here's my db structure:

usersRegistrationsTable - userID, registrationDate
usersTable              - userID, usersStatusesID