doulieyu0881 2016-07-18 17:58
浏览 34

如何在数据库中存储员工体验数据

I want to store employee experience data in database ,employee can i add multiple experience at a time .

Array :

Array
(
    [start_date] => Array
        (
            [0] => 2016-07-12
            [1] => 2016-09-16
        )

    [end_date] => Array
        (
            [0] => 2016-09-09
            [1] => 2017-01-20
        )

    [total_month] => Array
        (
            [0] => 2
            [1] => 4
        )

    [firm_name] => Array
        (
            [0] => sadsadasd
            [1] => 34343
        )

    [turnover] => Array
        (
            [0] => 343443434
            [1] => 443434
        )

    [student_experiece] => Array
        (
            [0] => 343434
            [1] => 343434
        )

    [orderof_supply_food] => Array
        (
            [0] => 343443
            [1] => 434343434
            [2] => 34334
            [3] => 34343
        )

    [payment_against_bill] => Array
        (
            [0] => 3434343
            [1] => 434343
        )

    [vat] => Array
        (
            [0] => 3434343
            [1] => 3434343434
        )

)

What i do is convert array in to string and than store in database like this:

[start_date] = 2016-07-12,2016-09-16,
[end_date] =2016-09-09,2016-01-20

Database Structure :

enter image description here i thing this not a right way .Please any suggestion?

  • 写回答

2条回答 默认 最新

  • duanqiao1949 2016-07-18 18:05
    关注

    You can use json_encode() to encode your PHP-Array to a JSON-String. When you get the JSON-String back from Database, you can decode it with json_decode() into an PHP-Array. Then you can modify it and store it back to database.

    评论

报告相同问题?

悬赏问题

  • ¥15 51单片机中C语言怎么做到下面类似的功能的函数(相关搜索:c语言)
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序
  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题