How to convert codeigniter format |
[eluser]Gowrisankar[/eluser]
hi, how to convert this mysql command in to codeigniter model SELECT * FROM user_details WHERE `cdate` BETWEEN DATE_SUB( CURDATE( ) ,INTERVAL 15 DAY ) AND CURDATE( ) I hope anyone can help me. Thanks
[eluser]bretticus[/eluser]
Not exactly sure what you mean, but if you are referring to converting your query to utilize ActiveRecord in CodeIgniter, note that you have MySQL-specific SQL syntax. Thus, the short answer is, don't even try since ActiveRecord is intended to be platform independent. Instead just use: Code: $this->db->query("SELECT * FROM user_details WHERE `cdate` BETWEEN DATE_SUB( CURDATE( ) ,INTERVAL 15 DAY ) AND CURDATE( )"); And then read up in the manual on how to generate query results.
|
Welcome Guest, Not a member yet? Register Sign In |