Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Developers:
LIKE %x% OR %y%
SteveX
Ultrabubble


Joined: 30 Aug 2005
Posts: 8792
Location: Ultrabubble

Posted: 09/30/13 09:22 
I'm adding search conditions in a search params listener and want to be able to use OR.


Code
 //WHERE (mymodule_field LIKE '%THIS%' OR mymodule_field LIKE '%THAT%')
$_data['search'][] = 'mymodule_field like %all% or mymodule_field like %143%';


Any ideas how to do that would be much appreciated.

Thanks


_________________
Kulshi Mezian!

"Stranger from another planet, welcome to our hole. Just strap on your guitar and we'll play some rock and roll"

Ultrabubble create things.
Back to top
Paul
Jamroom Team


Joined: 20 Aug 2003
Posts: 5341
Location: Nottingham, UK

Posted: 09/30/13 09:35 
'OR' is still elusive in JR5 as it was in JR4.
But with JR5 you can use 'IN', so maybe `my module_field` IN ('%This%', '%That%')
Not sure if that will work - just guessing . . .


_________________
Paul Asher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
SteveX
Ultrabubble


Joined: 30 Aug 2005
Posts: 8792
Location: Ultrabubble

Posted: 09/30/13 09:48 
Thanks Paul,

IN works, but not with the wildcards, so I guess I'm a bit stuck.


_________________
Kulshi Mezian!

"Stranger from another planet, welcome to our hole. Just strap on your guitar and we'll play some rock and roll"

Ultrabubble create things.
Back to top
Paul
Jamroom Team


Joined: 20 Aug 2003
Posts: 5341
Location: Nottingham, UK

Posted: 09/30/13 09:52 
Does IN with wildcards work in a straight query?
If so we can maybe build it in to jrCore_list


_________________
Paul Asher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
SteveX
Ultrabubble


Joined: 30 Aug 2005
Posts: 8792
Location: Ultrabubble

Posted: 09/30/13 12:02 
No, I think wildcards only work with LIKE.

Why is OR elusive? Is it for performance reasons?


_________________
Kulshi Mezian!

"Stranger from another planet, welcome to our hole. Just strap on your guitar and we'll play some rock and roll"

Ultrabubble create things.
Back to top
Paul
Jamroom Team


Joined: 20 Aug 2003
Posts: 5341
Location: Nottingham, UK

Posted: 09/30/13 12:12 
Think its just the way that the jrCore_list call is structured and search1="" search2="" etc. are logically ANDed.
Maybe there could be another parameter in the call to direct the searches to be ORed instead of ANDed. Not sure. Brian might have to chip in here.


_________________
Paul Asher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
SteveX
Ultrabubble


Joined: 30 Aug 2005
Posts: 8792
Location: Ultrabubble

Posted: 09/30/13 13:06 
I was trying in a search params listener, returning the $_data['search'][] directly which would give a bit more leeway. But couldn't get OR to work whichever way I tried.


_________________
Kulshi Mezian!

"Stranger from another planet, welcome to our hole. Just strap on your guitar and we'll play some rock and roll"

Ultrabubble create things.
Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Developers

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.