what's the point of serializing arrays to store them in the db?

前端 未结 5 698
感情败类
感情败类 2021-01-16 07:21

I see that people store arrays as like:

a:6:{i:0;s:5:\"11148\";i:1;s:5:\"11149\";i:2;s:5:\"11150\";i:3;s:5:\"11153\";i:4;s:5:\"11152\";i:5;s:5:\"11160\";}

5条回答
  •  深忆病人
    2021-01-16 07:49

    there is no mysql type array, and the reason is so you can recreate the array easily, if your data was as you showed it not hard but what about a multidimensional array with non numeric keys. Of course this is NOT good db practice in the first place, breaking normilisation

提交回复
热议问题