#Saving two different data types to a column (string and array)

3 messages · Page 1 of 1 (latest)

limpid vessel
#

Hello,

I'm working with dynamic form submissions. Most input values are fine to store as strings, but checkboxes need to be stored as arrays. I’d like to cast them conditionally based on the input type. However, my current approach is causing white screen errors. What would be the best way to handle this?

covert rapids
#

It depends on your requirements and setup. Are you storing one DB row per value? How do you know the input type after storing it?

spiral ridge
#

Json column is easy if you don't need to query within them