Hi,
        try

$expenses=$this->Expense->find('all',array(
                                'conditions'=> array(
                                     'Expense.name'=>'LIKE %S%' )));



This is what i have done in my App


$condition .= "(Applicant.name LIKE '%".addslashes($this->Session->read
('searchbond'))."%' )";


and then passing $condition there in find All



Best regards,

Deepesh Gairola



Tanay wrote:
> $expenses=$this->Expense->find('all',array(
>                                 'conditions'=> array(
>                                      'Expense.Name'=>'LIKE S%' )));
>
> the query generated from sql dump:
>
> SELECT `Expense`.`id`, `Expense`.`name`, `Expense`.`description`,
> `Expense`.`amount`, `Expense`.`date`, `Expense`.`tenant_id`,
> `Tenant`.`id`, `Tenant`.`name` FROM `expenses` AS `Expense` LEFT JOIN
> `tenants` AS `Tenant` ON (`Expense`.`tenant_id` = `Tenant`.`id`) WHERE
> `Expense`.`Name` = 'LIKE S%'
>
> ========
> at the end i want 'Expense'.'name' LIKE 'S%'
> but its giving `Expense`.`Name` = 'LIKE S%'
>
> whats wrong with my cakephp syntax?
--~--~---------~--~----~------------~-------~--~----~
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