S
S
Snewer2014-06-05 17:32:56
PHP
Snewer, 2014-06-05 17:32:56

Which way to store arrays?

Hello!
There is an array containing only int values ​​for each user. What is the best way to store this information?
Required:
- Extract arrays, find convergences / discrepancies
- Add / remove values
​​As an option, I consider the following:
- Store the array in the RDBMS
- Process on the client side (php), and overwrite the entire array in the database.
I am looking for the most rational and productive approach. Thank you!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey Burov, 2014-06-05
@Snewer

Use postgresql, it knows arrays.

I
Ilya Lesnykh, 2014-06-05
@Aliance

If the query level does not need a search for one of the numbers, then you can store the data in the form "int,int,int" ( implode(',', $array) ). Otherwise, you need to store in a separate entity, implementing a many-to-many relationship

F
Facetrollex, 2014-06-05
@Facetrollex

serialize

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question