Search using values from a multiple select option

2007-06-06 Thread hashkash
Hi! I have a multiple select option where the use can select 1 or more owners. I need to query the database based on the owners selected. There was an article i read

Re: Search using values from a multiple select option

2007-06-06 Thread Geoff Ford
This might be of use - it shows how to create OR conditions http://groups.google.com/group/cake-php/browse_thread/thread/4c05f96a111f7b33/bf00383ffee075f6?lnk=gstq=findall+%22or%22+%3D%3E+arrayrnum=1#bf00383ffee075f6 On Jun 6, 5:00 pm, hashkash [EMAIL PROTECTED] wrote: Hi! I have a

Re: Search using values from a multiple select option

2007-06-06 Thread Grant Cox
$owners = array('1','2','3') $equipment = $this-Equipment-findAll( array('Equipment.owner_id'= $owners) ); This will generate WHERE `Equipment`.`owner_id` IN ('1','2','3') which sounds like what you want. --~--~-~--~~~---~--~~ You received this message because

Re: Search using values from a multiple select option

2007-06-06 Thread hashkash
Thanks alot for the help on the OR condtions,but my problem related to the checking the owners is based on the number of owners the user selects.I cant code it directly.Its based on user selection. Any idea? Thanks! Kashyap --~--~-~--~~~---~--~~ You received this

Re: Search using values from a multiple select option

2007-06-06 Thread AD7six
On Jun 6, 9:32 am, hashkash [EMAIL PROTECTED] wrote: Thanks alot for the help on the OR condtions,but my problem related to the checking the owners is based on the number of owners the user selects.I cant code it directly.Its based on user selection. Any idea? don't use an OR and read what

Re: Search using values from a multiple select option

2007-06-06 Thread hashkash
$owners = array('1','2','3') $equipment = $this-Equipment-findAll( array('Equipment.owner_id'= $owners) ); Correct me if im wrong but from what grant Cox has written I construe that there are only 3 owners. In my case he no of owners keep growing as and when they register. The owners are selected

Re: Search using values from a multiple select option

2007-06-06 Thread hashkash
here is a part of the controller code http://bin.cakephp.org/view/486635630 --~--~-~--~~~---~--~~ 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

Re: Search using values from a multiple select option

2007-06-06 Thread AD7six
On Jun 6, 9:49 am, hashkash [EMAIL PROTECTED] wrote: $owners = array('1','2','3') $equipment = $this-Equipment-findAll( array('Equipment.owner_id'= $owners) ); Correct me if im wrong but from what grant Cox has written I construe that there are only 3 owners. mmm k. In my case he no of