Answer the question
In order to leave comments, you need to log in
Large arrays how to pass them to a MySQL column?
Hello everyone, I have several long arrays and for each array there is a column in the database, how can I transfer them there?
Answer the question
In order to leave comments, you need to log in
Vladik2109 ,
yes, how to make it rightAs a normal insert, the only thing to consider is the encoding and the sufficient length of the field in the table. In the database (obviously) you cannot directly store objects / arrays of any language, so you just add a string value.
and whether it is necessary to do something with the array before that?Naturally, you don’t work with the software environment, and any general-purpose storage can’t work with other people’s structures, so they store serialized data, in your case the array will need to be serialized via JSON.stringify() (well, parsing when pulling out from the database is natural ).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question