if ($this->request->is('post')) {
$from= $this->request->data["from"];
$to= $this->request->data["to"];
}
$vehicles= TableRegistry::get('Vehicles');
$vehicle = $vehicles->get($id, ['contain' => ['userdata','admindata', 'TrackingDevices', 'VehicleDetails', 'VehicleLocations']]);
where(["'$sDateToSearch' BETWEEN validFrom AND validUntil"])
I thought you had to have field BETWEEN value AND value
, not value BETWEEN field AND field
.
1 Like