New "OR" Support for jrCore_db_search_items

brian
@brian
12 years ago
10,149 posts
The latest push of Jamroom Core 5.1.0 now has support for using "OR" in your search conditions - i.e.

search1="user_name like %brian% || user_name like %brad%"

So you use the double pipe || to indicate that you want to have the core search on either of those items.

Note that the support does come with one requirement: You must search on the same FIELD in your OR conditions - i.e. this would NOT work:


search1="user_name like %brian% || user_email like %brad%"

Since we are searching for "user_name" in the first part, and "user_email" in the second. ALL search fields in an OR condition must be the same.

Let me know if you guys see any issues.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

updated by @brian: 12/06/13 10:52:16AM
paul
@paul
12 years ago
4,335 posts
That's cool - SteveX will be pleased. Is this in response to his post?
http://www.jamroom.net/phpBB2/viewtopic.php?t=42985


--
Paul Asher - JR Developer and System Import Specialist
brian
@brian
12 years ago
10,149 posts
Yeah for the most part - I've needed it on a couple occasions in the past as well, and figured it would be asked for again in the future, so I coded it in this morning.

If you can test it out real well and let me know if you see any issues, that would be great.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
SteveX
SteveX
@ultrajam
12 years ago
2,584 posts
I'll have to get another dev site going on 5.1.0, but it will get a thorough test tomorrow.

Thanks Brian!!!


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
michael
@michael
12 years ago
7,793 posts
cool
brian
@brian
12 years ago
10,149 posts
My latest push of the 5.1.0 Core module now removes the "same key" requirement from the OR searches - you can now do something like:

user_name = brian || user_email like %brian% || user_language = en-US

So it should be really powerful.

Let me know if you guys see any issues.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Developer Networks
Developer Networks
@developer-networks
12 years ago
566 posts
very cool

Tags