How to search the query written in cake php.the query is too
difficult

        $select_sql = "SELECT * FROM `events_register` AS `table_one` ,
`event_profileinform` AS `table_two`
                                                WHERE `table_one`.`id` = 
`table_two`.`userid` ";
                if($gender == "male")
                {
                        $select_sql = $select_sql. " AND `table_one`.`gender` = 
'Male' ";
                }

                        else if($gender == "female")
                        {
                                $select_sql = $select_sql. " AND 
`table_one`.`gender` = 'Female'
";
                        }

                else
                {
                        $select_sql = $select_sql." AND `table_one`.`gender` != 
'' ";
                }


                if ($max_age && $min_age)
                {
                        $select_sql = $select_sql. " AND YEAR(CURDATE())-
RIGHT( `table_two`.`birth_date` , 4 )  between $min_age and $max_age
";
                }

                if($status_swinger || $status_married || $status_inrelationship 
||
$status_divorced || $status_single)
                {
                        $select_sql = $select_sql. " AND ( ";
                }

                if($status_single)
                {
                        $select_sql = $select_sql. " `table_two`.`status` =
'$status_single' ";
                        $testvar        = 1;
                }
it is a normal php coding like that i need using cake php


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to