hello friends,
Any one please help me to convert this query into cakePHP find statement?
$sql = "select
categories.id
FROM
categories
WHERE
categories.competition_id='".$id."' AND ".
$logger['Competitor']['weight']. " between categories.weight_min and if(categories.weight_max>0,categories.weight_max,1000) AND ".
$logger['Competitor']['height']. " between categories.height_min and if(categories.height_max>0,categories.height_max,1000) AND ".
(date('Y')- substr($logger['Competitor']['dateofbirth'],0,4 ))." between categories.age_min and if(categories.age_max>0,categories.age_max,100) AND \"".
$logger['Competitor']['gender']."\" = categories.gender AND ".
$logger['Competitor']['grade']." between categories.grade_from and if(categories.grade_to>0,categories.grade_to,100)
";