adaxa
adaxa

Reputation: 1608

mysql codeigniter

How to do BETWEEN query with codeigniter's active record?

Upvotes: 0

Views: 688

Answers (2)

keithics
keithics

Reputation: 8758

simple..

use this:

$this->db->where("sampledate between '$start' and '$end'",NULL,false);

Upvotes: 1

ifaour
ifaour

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

Related Questions