Wednesday, April 27, 2011

Assemble IN clause for paginate

1. I have a stored procedure that return an array of ids and can
return a comma delimited string of ids if its better
2. A have a paginator that return all the data from a table.
3. When the user perform a search I take the search parameters and
call the stored procedure.

Now I have an array or string that I want to use as a condition to the
paginator

$this->set('assets', $this->paginate(array('Asset.id IN' =>
$searchTerm)));

Well its not working.

I tried to add '('.$searchTerm.')' with no success
And several more things

Thank you

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: