Welcome Guest, Not a member yet? Register   Sign In
Date comparison - Less than 24 Hours in Models
#1

(This post was last modified: 06-12-2024, 09:36 AM by Anharr.)

I have the following queries in CodeIgniter to find any data in which the date_created field is less than 24 hours. 
Here is my code in Models


Code:
public function checkDeposit($preOrder)
    {
        return $this->db->table('deposit')
        ->where('preorder_code', $preOrder)
        ->where('status', 0)
        ->where('date_created <', strtotime(date('YmdHis'), INTERVAL 1 DAY))
        ->get()
        ->getRowArray();
    }


But the above query is not working.
What I want in short is, return all rows which the date_created is less than 24 hours.
My date_created format is Unix TimeStamp (1718204380)
How to get data less than 24 hours in Models ?
Reply


Messages In This Thread
Date comparison - Less than 24 Hours in Models - by Anharr - 06-12-2024, 09:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB