active record - where() using < or >

I want to select some data from database where timestamp is greater than NOW().

Is it possible to do it without manually creating the query?

$this->db->where('col'<'sth2') doesn't work. Is there a plan to add the support for >,<,<=... operator, for example: $this->db->where('col','sth2','>')

Hi marcello100 and welcome tothe CI forums.

I don't use the AR queries, but it looks like you may just have a typo.

Quote:$this->db->where('col'<'sth2') doesn't work.

In the manual it suggests an example of:
$this->db->where('id <', $id);

Your code is

The logical operator should be with the table field/column. Like this
$this->db->where('col operator','value')

   $this->db->where('name =','khagendra')
   $this->db->where('id <','10')
   $this->db->where('name !=', $name);
   and so on

oh, I just found it in the active record user guide, sorry for bothering and thank you Smile
works as expected.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.