Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

datalist query multiple columns


Go to End


709 Views

Avatar
Guy Van Bael

Community Member, 61 Posts

6 October 2012 at 3:48am

Hi,

I found this in the doc section, but somehow i can't seem to make it work. Adding multiple colums to query returns server error.

**** this is the doc ****
If you wish to match against any of a number of columns, you can list several field names, separated by commas. This will return all members whose first name or surname contain the string 'sam'.

$members = Member::get()->filter(array(
'FirstName,Surname:PartialMatch' => 'sam'
));

**********

Anyone got this working?