I have just started to use php active record to select rows between 2 dates, it seems to work on some tests but on some it fails, this is what i have so far
$to = $_POST['to'];
$from = $_POST['from'];
$visitors = Visitors::find('all', array('conditions' => "visitdate >= '$from' AND visitdate <= '$to'"));
is there a between clause available?
Thank you
You’ll need to designate
visitdateas aDATEin order to compare the strings.More here: http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#operator_between