I am trying to store JSON data (pretty much an array in PHP, which may be of unknown length) in a column that will allow me to make queries on it. Let me use this as an example ...
Say that I have a box asking what kind of sport you like (and this is a check box).
[] Soccer [] Hockey [] Football [] Swimming
which will then be sent through the sports[] array in PHP. Then I want to take this and add it to my database so that it looks like
|sports|{hockey:false,swimming:true,football:false,soccer:true}|
Or something like that, then I could go
SELECT COUNT(*) FROM fields WHERE hockey = "false";
And I canβt understand how to do it right, ignore the fact that this βexampleβ could be easily done by joining it, I want to do this using the mariadb dynamic columns (at least I believe that, what i want). I know I can do this with Postgre.
json database mariadb
Steven
source share