I'm using select2 + multiple:
I'll give a simplified example:
- in object select tab: 1|Red|2|green|3|blue.
- field in the table -> 'color' varchar (255)
If in the object (select2 + multiple) I select (red and blue) in the 'color' field of table, ["1","3"] is stored, I think that's a json string!!.
At this point in a query I want to find (for example) all the records that have on this string (in field) the color set to "blue" ("3").
I try with json_extract and json_search statement but it returns me all the records or nothing.
In the real solution I'm actually developing i would like to use the field in an address book to insert some kind of tag and then use the contact based on the tags in specific parts of the database.
What is the mysql query to make this selection?!
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Query on Select2+multiple field
-
- nuBuilder Team
- Posts: 4297
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
-
- Posts: 41
- Joined: Thu Sep 30, 2021 10:32 am
Re: Query on Select2+multiple field
I made it too hard...
I had tried but not with the double "%" ...
it works! it works!
Thanks Kevin

I had tried but not with the double "%" ...
it works! it works!
Thanks Kevin