$array = Array ( [type] => Array ( [0] => course [1] => course )
[c_name] => Array
(
[0] => mca
[1] => bca
)
[year] => Array
(
[0] => 2013
[1] => 2010
)
[status] => Array
(
[0] => pursuing
[1] => completed
)
[entity_type_rm_id] => Array
(
[0] => 1
[1] => 1
)
)
我正在使用: foreach($array as $row){ 如何创建此数组以存储在 db 表中?}
表名
entity_type_rm_courses
和表格列
id | entity_type_rm_id | type | c_name | year | statue
我想设置这样的值
id | entity_type_rm_id | type | c_name | year | statue
--- ------------------- -------- -------- ------ ---------
1 | 1 | course | mca |2013 | pursuing
2 | 1 | course | bca |2010 | completed
我想使用 createRow() 方法在表中插入记录
$courseRow = $courseTable->createRow($Course);
$courseRow->save();
$courseRow = $courseTable->createRow($Certification);
$courseRow->save();