Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6797409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:36:21+00:00 2026-05-26T18:36:21+00:00

During insert campaign, i am storing multiselected (checkbox List) events id stored using comma

  • 0

During insert campaign, i am storing multiselected(checkbox List) events id stored using comma separated in campaign table. like 1,4,5,6

Now when i try to search campaign information based on these events ids, its not working proper . means when i try to search campaign by selecting event_id 1 ,it also search fields like 12,3,2 or 6,21,22 .

My search string is like following.

SELECT *
FROM `crm_campaign`
WHERE `event_ids` LIKE '%1,%'
OR `event_ids` LIKE '%,1,%'
OR `event_ids` LIKE '%,1%'

please give me suggestion.

should i change data structure for multiselect fields ?

Now i am inserting event_ids like ‘1’,’4′,’5′
Is it right approch ?
If Yes then then how to use search string in asp.net because these escape character gives me problem for mysqlcommand paramter.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:36:22+00:00Added an answer on May 26, 2026 at 6:36 pm

    Try concatenating commas to the start and end of event_ids in the WHERE clause:

    SELECT *
    FROM `crm_campaign`
    WHERE concat(',', `event_ids`, ',') LIKE '%,1,%'
    

    Due to the nature of the table design, it will be slow if your table contains many rows.
    If this becomes an issue, move the event ids into a separate related table.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What happens in mysql multiple records insert during an error. I have a table:
I have a problem during an insert in Oracle using Java and JDBC. The
During execution, how can a java program tell how much memory it is using?
Table in MySQL have 1 problem column: creation_date . During inserting a new row
During development I came across a strange scenario using DD with Macedonian_FYROM_90_CI_AS Collation. declare
I'm trying to insert values in the table but when I click on the
Using LINQ-to-SQL, I would like to automatically create child records when inserting the parent
I have the following cursor (something like it anyways) that I am using to
I have several transactions to insert form data into oracle table. if (InsertQuarterly() ==
I have tried an example in which i have inserted a user using insert

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.