doushu5805 2013-08-13 07:18
浏览 30
已采纳

将PHP数组存储在Mysql数据库中

What is the best way to store/retrieve an array in a Mysql database? Is serializing the data the best way?

I am looking for neat, nice way to do this.

  • 写回答

1条回答 默认 最新

  • dsfliu1129 2013-08-13 07:25
    关注

    Serializing is actually a worst way ever.

    It is like if you cut a door from your expensive car, and use it as a sleigh, only because being too lazy to get some gas. Mysql is an expensive car and it have to be used properly, and solution have to be not a quick and dirty one but out of reason and knowledge.

    The solution depends on the nature of the data in this array and most likely will involve a separate table (as tables in mysql being pretty much arrays themselves)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥200 相机拍直接转存到电脑上 立拍立穿无线局域网传
  • ¥15 (关键词-电路设计)
  • ¥15 如何解决MIPS计算是否溢出
  • ¥15 vue中我代理了iframe,iframe却走的是路由,没有显示该显示的网站,这个该如何处理
  • ¥15 操作系统相关算法中while();的含义
  • ¥15 CNVcaller安装后无法找到文件
  • ¥15 visual studio2022中文乱码无法解决
  • ¥15 关于华为5g模块mh5000-31接线问题
  • ¥15 keil L6007U报错
  • ¥15 webapi 发布到iis后无法访问