Hi,
I have implimented a search using the code below which works well, but
it only searches one field. What I'd like is a drop down box in the
view to select the feild to be searched (name, address, postcode,
etc). However i'm not sure how to reflect this in the controller code.
I wonder if someone could give me a hint?
Thanks,
Mike.
function search() {
if(empty($this->data)) {
$this->render();
} else {
$conditions =array();
$search_term = $this->data['Enquiry']['surname'];
$conditions['Enquiry']['surname'] = "LIKE %{$search_term}
%";
$query = $this->Enquiry->findAll($conditions);
$this->set('data', $query);
$this->render('search');
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---