How to collapse a dataset in place?

Good day!

In General, write a small application.
Users have settings, for example to notify them of changes or not, to send news by mail or not. All the settings are binary, i.e. on/off. The whole thing should be stored in the database. On the one hand you can create a bunch of columns and thus save settings, but it takes a lot of space and not as convenient.

An example of a configuration array:

$array["notification"] = true;
$array["welcome_msg"] = false;

Is there a way to collapse somehow the array of binary data into a single hash, which could, if desired, back to deploy?
July 2nd 19 at 17:31
1 answer
July 2nd 19 at 17:33
Thank you. And that will be adequate, multiple columns or serialize? - Nicolas_Ha commented on July 2nd 19 at 17:36
then you can decide. separate columns allow you to save/retrieve the data without additional processing; to produce them on the search.
if you only need to keep them, then it will go and serializing to a string. - kavon.Murphy commented on July 2nd 19 at 17:39
I usually make the column properties, or options in json format. But it's not always applicable (e.g. not make the search options). - clovis.Veum49 commented on July 2nd 19 at 17:42

Find more questions by tags MySQLPHP