I'm hoping someone can help.  I'm fairly new to CakePHP but am
thoroughly enjoying coding with it.

Basically I've got a field within a table that contains my content.
I'm trying to grab the search terms from a single input, explode them
and search the content section for each term individually.

I'm doing something along these lines:

$term = $this->data['Question']['searchTerm'];
                        $splitTerms = explode(" ",$term);
                        foreach($splitTerms as $splitTerm):
                                
$conditions['conditions']['OR']['Question.content LIKE'] = array("%
$splitTerm%");
                        endforeach;
$this->set('questions',$this->Question->find('all',$conditions));

My dilemma is basically in setting the conditions... because
'Question.content LIKE' can only contain one value, I can't build an
array within my foreach loop that I can then pass to the find method
to build a full SQL query.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to