Skip to Content Skip to Menu

[SOLVED] Error is display list with regex

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
9 years 6 months ago - 9 years 6 months ago #263243 by krileon
Replied by krileon on topic Error is display list with regex
You might be able to use a word anchor to prevent that. Example as follows.

Code:
`cb_teams` REGEXP IF( '[cb_teams]' != '', CONCAT( '[[:<:]]', REPLACE( '[cb_teams]', '|*|', '|[[:<:]]' ) ), 'NOVALUE' );


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 9 years 6 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • comyoo
  • comyoo
  • OFFLINE
  • Posts: 87
  • Thanks: 1
  • Karma: 0
9 years 6 months ago #263531 by comyoo
Replied by comyoo on topic Error is display list with regex
Hi,

Thanks for the reply. The code results in an error. Team can also be a word. Maybe that is the problem?
Code:
1064 FOUT: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; )' at line 7 SQL=SELECT COUNT( DISTINCT u.id ) FROM nkb57_users u JOIN nkb57_user_usergroup_map g ON g.`user_id` = u.`id` JOIN nkb57_comprofiler ue ON ue.`id` = u.`id` WHERE u.block = 0 AND ue.approved = 1 AND ue.confirmed = 1 AND g.group_id IN (6, 7, 2, 3, 9, 4, 5, 14, 20, 18, 21, 36, 37, 27, 38, 28, 35, 29, 22, 24, 19, 33, 15, 25, 34, 31, 26, 13, 16, 17, 10, 30, 11, 12, 8) AND ( `cb_teams` REGEXP IF( 'comyoo' != '', CONCAT( '[[:<:]]', REPLACE( 'comyoo', '|*|', '|[[:<:]]' ) ), 'NOVALUE' ); )

What would be the solution to this error?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
9 years 6 months ago #263561 by krileon
Replied by krileon on topic Error is display list with regex
Remove the ; in the above as you're using it inline.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • comyoo
  • comyoo
  • OFFLINE
  • Posts: 87
  • Thanks: 1
  • Karma: 0
9 years 6 months ago #263566 by comyoo
Replied by comyoo on topic Error is display list with regex
Hi,

Your comment resulted in no error, but not the right query.

Now only a list of people with the exact combination of multiple teamnumbers is shown, but it should show everyone that is also on the first teamnumber and also every other person that matches the second teamnumber.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
9 years 6 months ago #263574 by krileon
Replied by krileon on topic Error is display list with regex
Probably needs capture groups for the word boundry to work correctly per value. Try the below.

Code:
`cb_teams` REGEXP IF( '[cb_teams]' != '', CONCAT( '([[:<:]]', REPLACE( '[cb_teams]', '|*|', ')|([[:<:]]' ), ')' ), 'NOVALUE' )

The above would be trying to match the below REGEX for example, which you can directly test in phpmyadmin.

Code:
([[:<:]]20)|([[:<:]]320)


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum