Related Records with Mulit-select

3 posts by 2 authors in: Forums > CMS Builder
Last Post: September 5, 2019   (RSS)

By Toledoh - September 4, 2019

I've added a related records field in a section that is looking for matching wigs.  The MySQL is not displaying any results, but the more link is - I'm guessing because the related field is a pillbox (multi value).

MySQL Where:  wigsNum='<?php echo mysql_escape(@$RECORD['num']) ?>'

More Search Link: wigsNum_match=<?php echo htmlencode(@$RECORD['num']) ?>

I've tried changing the "=" to LIKE or CONTAINS etc.  Any thoughts?

Cheers,

Tim (toledoh.com.au)

By daniel - September 5, 2019

Hey Tim,

Multi-value fields are stored separated by tabs (\t), so using "LIKE" and some wildcard symbols (%) you should be able to do something like this:

wigsNum LIKE "%\t<?php echo mysql_escape(@$RECORD['num']) ?>\t%"

Let me know if that does the trick!

Thanks,

Daniel
Technical Lead
interactivetools.com

By Toledoh - September 5, 2019

Perfect!

Thanks Daniel.

Cheers,

Tim (toledoh.com.au)