thinkphp3.2.3 problem
黄舟
黄舟 2017-05-24 11:33:24
0
4
767

Excuse me
Array
(

[after_one] => Array
    (
        [0] => 124124
        [1] => 2342
    )

[task_one] => Array
    (
        [0] => 124
        [1] => 41234234
    )

[time_one] => Array
    (
        [0] => 2017-05-19
        [1] => 2017-05-19
    )

[complete_one] => Array
    (
        [0] => 完成途中
        [1] => 未完成
    )

[score_one] => Array
    (
        [0] => 2
        [1] => 2
    )

[reason_one] => Array
    (
        [0] => 124124
        [1] => 124124
    )

[next_one] => Array
    (
        [0] => 412412
    )

[task_two] => Array
    (
        [0] => 12412
    )

[time_two] => Array
    (
        [0] => 2017-05-13
    )

[result_two] => Array
    (
        [0] => 124124
    )

[reason_two] => Array
    (
        [0] => 1231234
    )

)

How to insert this into the database? How to cycle? Here are two pieces of data [0] one [1] one, please help me, thank you
Sorry, please add the database structure now

id after_one task_one time_one complete_one score_one reason_one next_one task_two time_two result_two reason_two
These are field names. Now according to this, there should be two pieces of data. How to insert them into the database?

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(4)
Peter_Zhu

json_encode()

漂亮男人

Isn’t this possible?

$beans=array();
foreach($data as $k=>$v){
 foreach($v as $vK=> $vItem)
 {
     $beans[$vk][$k]=$vItem;
 }
}

var_dump($beans);
phpcn_u1582

Just cycle through it yourself.

.............

$arr1=array();
$arr2=array();

for($arr as $k=>$v){
      $arr1[$k]=$arr[$k][0];
      $arr2[$k]=$arr[$k][1];
}
小葫芦

What is the table structure? How to save?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!