When I need a table to set settings for my app. I always use table with many fields:
create table options (
id ...
url ...
keys ..
path ...
)
Of course I need one ID (because I have one settings)
Could I use other approach like:
create table options (
id ...
field ..
)
When field is for example:
`key => value`
So I don’t need to set many fields ..
BS:
The fields have different types: int text datetime .. etc
Sure, you can do that. Just make sure you cast to the correct type when taking the values out of the database, and, similarly, when inserting or updating them.
PHP example:
For the above example, your schema will need a
field(varchar) and avalue(varchar).