Search through JSON / Finding values in JSON

luken 09 Nov, 2020
Hey there,
I'm trying on the following:

Let's say I select the value
Peter
in a dropdown. Value and Text is identical.

I read in a table which has a specific column with a json encoded string. Each dataset / row has a different string, so for example:
row with id 1: ["Sarah", "Peter", "Tom"]
row with id 2: ["Tobi", "Jane", "David", Ellis"]

What I like to do is, just to delete the datasets where the value Peter (or whatever I select in the dropdown) occures.
So, referring the example above: Just row with id 1 will be deleted.

I know how to delete datasets through setting "Where conditions" but how can I so-to-say "search" through the json string for each dataset?

Any idea?
Max_admin 11 Nov, 2020
Answer
1 Likes
try to use LIKE:
LIKE %"Peter"%
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
luken 11 Nov, 2020
1 Likes
WOW, that works! Thank you so much!
You need to login to be able to post a reply.