【发布时间】:2015-12-27 17:40:25
【问题描述】:
我选择了多个这样的表单:
<label style="width: 150px; float: left">Co Auditor</label>
<select name="co_auditor_nip[]" multiple = 'multiple' size=6>
<?php
foreach ($co_auditor_nip->result() as $row)
{
echo '<option value="'.$row->nip.'"';
if($co_auditor_nip_choosen == $row->nip)
{
echo 'selected="selected"';
}
echo' >'.$row->nama.'</option>';
}
?>
</select><br>
然后我想像这样使用 php codeigniter 将值插入数据库:
$co_auditor_nips['co_auditor_nip'] = addslashes($this->input->post('co_auditor_nip'));
$this->db->query("INSERT INTO r_audit VALUES (' ', '$company_code', '$company_name', '$branch_code',
'$branch_name','$business_unit', '$lead_auditor_nip', '$lead_auditor', '$co_auditor_nips', '$co_auditor',
'$periode_audit_from','$periode_audit_to', '$tanggal_audit_from', '$tanggal_audit_to', '$auditee', '$auditee_jabatan',
'$auditee_email',
'$auditee_2','$auditee_2_jabatan' ,'$auditee_2_email', '$cc_email', 'started', '1')");
但我在数据库上的列结果只是数组(文本数组),请帮我获取所有值,谢谢!
【问题讨论】:
-
在控制器中打印
$_POST并检查即将发生的事情.. -
消息:数组到字符串的转换文件名:controllers/apps.php 行号:408 结果是数组(文本数组)
-
第408行是查询还是addlashes()行??
标签: php mysql codeigniter select