-
-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save non-searchable unstructured data/settings in DB #158
Comments
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. Therefore, you should accept the colleague's suggestion with praise. |
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...
The text was updated successfully, but these errors were encountered: