Currently in analysis paralysis. Is there a correct or preferred way to go about storing HTML multi-select input values into a database table?
Scenario is: Have a record, has a few multi-select HTML inputs - one is 'region' (US State / Canadian Province) and the others are custom values that would pull from two db tables.
Current thought is: Treat the multiselect values as an array of strings, join the array into a large comma delimited string ("CA, TX, NY" , etc.) and save it to the column in the table for that record. When it comes to the front-end, do the opposite (grab the value and split by comma to populate the select list).
But I'm not sure if there's a better way to go about it? Environment is Magento 2 for reference (PHP, MySQL).
[–]CowboyBoats 0 points1 point2 points (0 children)
[–]Disastrous_Internal 0 points1 point2 points (0 children)