V
V
Vladik21092022-04-21 01:03:14
MySQL
Vladik2109, 2022-04-21 01:03:14

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

1 answer(s)
T
ThunderCat, 2022-04-21
@Vladik2109

Vladik2109 ,

yes, how to make it right
As 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 question

Ask a Question

731 491 924 answers to any question