Welcome Guest, Not a member yet? Register   Sign In
How to convert codeigniter format
#1

[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
#2

[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.
#3

[eluser]Gowrisankar[/eluser]
thanks




Theme © iAndrew 2016 - Forum software by © MyBB