Storing in array or in fields? Which is better?
Today I was working on my website and I asked myself a simple question.
Does storing an array with all informations is better than saving those
one in different fields?
For example if I store an ID, a password and a number in one field on the
database in this way
+-------------+----------------------------------------------------------------+
| Field | Value
|
+-------------+----------------------------------------------------------------+
| all |
["1","fa26be19de6bff93f70bc2308434e4a440bbad02","25468684888"] |
+-------------+----------------------------------------------------------------+
Is it better than saving it in this way?
+-------------+------------------------------------------+
| Field | Value |
+-------------+------------------------------------------+
| id | 1 |
| password | fa26be19de6bff93f70bc2308434e4a440bbad02 |
| number | 25468684888 |
+-------------+------------------------------------------+
I think that the first method is faster than the last one because you need
only to SELECT one field and not three or more. What do you think about
it?
No comments:
Post a Comment