Because the $sql is built from the input separated by , so it will search
Mary, Tom as 

SELECT `Post`.`id` FROM `Posts` AS `Post` WHERE `Post`.`status` = 0 AND
`Post`.`rank` <= 0 AND `Post`.`title` LIKE '%mary%' OR `Post`.`description`
LIKE '%mary%' OR `Post`.`title` LIKE '%tom%' OR `Post`.`description` LIKE
'%tom%' 

And not LIKE '%marytom%'

It creates a string based on the values entered into the search.

-----Original Message-----
From: Miles J [mailto:[email protected]] 
Sent: September-06-09 6:07 PM
To: CakePHP
Subject: Re: Query Help


Why dont you just use the built it or mechanics?

'OR' => array('Post.title LIKE' => '%'. $value .'%', 'Post.description LIKE'
=> '%'. $value .'%') 

--~--~---------~--~----~------------~-------~--~----~
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