dousonghs58612 2010-02-03 10:47
浏览 16

将mysql值分配给多维数组

I am trying to display a multidimensional array into html table using php nd mysql.

The array structure is like below

Array
(
    [az] => Array
        (
            [0] => Array
                (
                    [work] => dsdsds
                    [time] => 2:47---2:55
                    [total] => 8
                )

        )

    [an] => Array
        (
            [0] => Array
                (
                    [work] => sdsdsdsdsd
                    [time] => 1:47---2:47
                    [total] => 60
                )

        )

    [mu] => Array
        (
            [0] => Array
                (
                    [work] => sdsdsd
                    [time] => 1:30---2:48
                    [total] => 78
                )

        )

    [raj] => Array
        (
            [0] => Array
                (
                    [work] => dsdwew
                    [time] => 3:34---3:40
                    [total] => 6
                )

            [1] => Array
                (
                    [work] => cdsfdfdfd
                    [time] => 3:25---3:35
                    [total] => 10
                )

        )

)

it will go through columns first and then it will come to rows like this

user1   user2   user3
aa      bb      cc

Plz suggest..

  • 写回答

2条回答 默认 最新

  • doudula1974 2010-02-03 10:53
    关注

    U should read about foreach.

    http://php.net/manual/en/control-structures.foreach.php

    And I think that inserting this values into table won't be any problem.

    评论

报告相同问题?

悬赏问题

  • ¥15 matlab中使用gurobi时报错
  • ¥15 WPF 大屏看板表格背景图片设置
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂