mysql - How to select a date less than the current one? -


i want load appointment history of customer db, each record have start_datetime , end_datetime, query looks this:

$query = $this->db         ->select('*')         ->from('appointments')         ->where('id', 5) 'id of record select         ->where('start_datetime' ) 'here's indecision         ->get()->result_array(); 

essentially record load should record previoulsly of current datetime. how can pass condition in clause?

try this

$now = date('y-m-d h:i:s'); # current time stamp $query = $this->db         ->select('*')         ->from('appointments')         ->where('id', 5)         ->where(start_datetime <= $now ) # date($now)         ->get()->result_array(); 

Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -