I am working on a Mysql trigger to do something on my database. Before any thing, I want to check if a value exists in a json_encode string in my config table and after that proceed to run the trigger.
my config table is handled by php scripts and looks like this:
-------------------------------------------
| config_name | config_value |
-------------------------------------------
| target_id | ["1","16","18","22","37"] |
-------------------------------------------
in php we can use:
if in_array(json_decode(config_value)) and ...
but my problem is in Mysql syntax which doesn't support in_array and json_decode
How can I check if my value exists in 'config value' in Mysql trigger?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…