Reputation: 1608
How to do BETWEEN query with codeigniter's active record?
Upvotes: 0
Views: 688
Reputation: 8758
simple..
use this:
$this->db->where("sampledate between '$start' and '$end'",NULL,false);
Upvotes: 1
Reputation: 38135
As a standalone method $this->db->between('field_name', 'min_value', 'max_value')
, NO it does not exists. But you can use custom query strings in the where()
method:
$this->db->where('age BETWEEN 18 AND 25', NULL);
Just search the CI forums, and you will find a couple of threads about it.
Upvotes: 5