Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 ANDing multiple values in a field
umetkaran Offline
Member
***
Posts: 110
Joined: Aug 2014
Post: #8
RE: ANDing multiple values in a field
(09-24-2015 03:12 AM)ln_e Wrote:  Thanks for the help anyway! Smile

I think I've figured it out in the meantime, although would still like to know if there is a less hacky solution.

For anyone looking to do something similar, this is the part that handles multiple select queries in xt_forumdhooks.php


Quote:$qstr .= $qor.$cfield.' LIKE "'.$qlpre.xthreads_forumdisplay_filter_parselike($v, $filtermode).$qlpost.'"';
if(!$qor) $qor = ' OR ';

This is where the multiple values are ORed together, you can just duct tape it with an AND:

Quote:$qstr .= $qor.$cfield.' LIKE "'.$qlpre.xthreads_forumdisplay_filter_parselike($v, $filtermode).$qlpost.'"';
if(!$qor) $qor = ' AND ';


Not a pretty solution by any means, but it does the job.

(09-29-2015 12:24 PM)ZiNgA BuRgA Wrote:  Your solution is probably the best there is.  I'm not sure if there's a nice way to toggle OR/AND, so I picked the most likely to be used, OR.

i try this way, but not work. & filter mode i changed (exact macth, contains, wildcard)

for simple choosing (with little choice), i try RateU solution.

wowtopik.com -> + marketplace forum & youtube sharing
webdiskus.com -> + website marketplace (domain, web, hosting etc)
(This post was last modified: 02-03-2017 10:22 AM by umetkaran.)
06-22-2016 06:05 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
ANDing multiple values in a field - ln_e - 09-23-2015, 11:45 PM
RE: ANDing multiple values in a field - umetkaran - 06-22-2016 06:05 PM

 Standard Tools
Forum Jump: