Open dhoomm opened 7 years ago
Recently almost all databases started to support JSON including searching. Should be better than serialize, unserialize. Another way is normalized version of it called EAV.
Thanks for the info about JSON support even in relational databases. My vendor has old version of MySql DB, will use this for now...
@samdark, this is certainly a good recipe. A lot of system runs on old databases but they are still in full development.
Therefore, you should accept the colleague's suggestion with praise. Be careful not to prune the suggestions based solely on your personal opinion. The world is much more complex than that 😉
I'm not declining it. Just mentioned that there could be better ways doing that.
Many times we need to save user editable options in DB. We would have to create a table to save a single record. Instead, this is what i use at the moment.
DB:
Create a base class.
Useage: Create a new Class, e.g.
Now this can be used in controller as:
Of course this won't work for wordpress type requirement where multiple options need to be loaded on each request, enable autoload, etc. Expecting suggestions...