regex - How to deal with user options and mysql database -


I am writing a PHP program, each content has some options that store user preferences. For example:

  • Where should the content be shown in the template?
  • In what categories or pages, content should be loaded?

Now, I have named these data in a code in the options JSON. The end result is something like this:

  {"loces": ["en"], "theme": {"default": {"width": "0", "height": "0", "top": "0", "right": "0", "bottom": "0", "left": "0"}}, "page": ["aboutus \ /"], "Categories": ["all"], "homepage": "wrong"}  

There is no problem in selecting my data and filtering rows by using the mysql regexp statement . But I have 3 other questions:

  1. How to update a JSON field value in a single update statement?
  2. Is it such a move to be completely (I'm using JSON)?
  3. What other solutions do you suggest to store options, while there are so many properties stored?

AFAIK, there is no complete way to do that none- NoSQL database Like MySQL, however, for JSON not at all, you can see and it can give you some ideas.


Comments