SQL CURDATE() in activerecords where clause |
[eluser]florin[/eluser]
how do you put SQL functions like CURDATE() in active records Where clause to compare I have a date field in mysql named "data" and i need to select the records that have data> curent data. It seems that $this->db->where('data >',CURDATE()) is not working . Tks mates !
[eluser]Silviu[/eluser]
This is from the User Guide: Quote:$this->db->where() accepts an optional third parameter. If you set it to FALSE, CodeIgniter will not try to protect your field or table names with backticks. So your query should look like this: Code: $this->db->where('`data` > CURDATE()',NULL,FALSE); Code: $this->db->where('`data` >','CURDATE()',FALSE); Pick your poison
|
Welcome Guest, Not a member yet? Register Sign In |