我一直在尝试创建一个combobox
具有两个输入字段的,本质上是一个表单。
这是我的组合框:
<select name="answers[]" id="answers">
<option value="<?PHP echo $cevap_list['CRM7101']; ?>,<?PHP echo $cevap_list['CRM7105']; ?>"><?PHP echo $cevap_list['CRM7103']; ?></option>
我试图在 PHP 脚本中以 POST 形式接收这些值:
$answers= $_POST['answers'];
for($p=0;$p<=count($answers);$p++){
$answer_explode = explode(",",$answers[$p]);
$answer_id = $answer_explode[0];
$answer_value = $answer_explode[1];
}
for($i=0;$i<count($answer_id);$i++){
$cevapkontrol = trim($answer_id[$i]);
$sorgu = mysql_query("insert into CRM9001(CRM9107,CRM9106) values ('".$answer_value[$i]."','".$answer_id[$i]."') ");
}
但它似乎不起作用?难道我做错了什么?