PHP从数据库中删除dropdownlist 2项
我是PHP新手。这是一个现有的系统。我被告知从下拉列表中删除2项。下拉项取自mysql数据库。当前下拉列表中有3项:ICD、产品和医生费用。我被告知取消产品和医生费用 PHP中的代码:PHP从数据库中删除dropdownlist 2项,php,mysql,csv,Php,Mysql,Csv,我是PHP新手。这是一个现有的系统。我被告知从下拉列表中删除2项。下拉项取自mysql数据库。当前下拉列表中有3项:ICD、产品和医生费用。我被告知取消产品和医生费用 PHP中的代码: function split_csv_line($record) { $first = NULL; if (strlen($record) == 0) { return array(''); } if ($record[0] === '"') {
function split_csv_line($record) {
$first = NULL;
if (strlen($record) == 0) {
return array('');
}
if ($record[0] === '"') {
$first = '';
$start = 1;
while ($start < strlen($record)
&& ($end = strpos($record, '"', $start)) !== FALSE
&& $end < strlen($record) - 1
&& $record[$end + 1] !== ',')
{
if ($record[$end + 1] !== '"') {
die("Found characters between double-quoted field and comma.");
}
$first .= substr($record, $start, $end - $start - 1);
$start = $end + 2;
}
if ($start < strlen($record) || $end === FALSE) {
die("Could not find end-quote for double-quoted field");
}
$first .= substr($record, $start, $end - $start - 1);
if ($end >= strlen($record) - 1) {
return array($first);
}
/* Assertion: $record[$end + 1] == ',' */
$rest = substr($record, $end + 2);
} else {
$end = strpos($record, ',');
if ($end === FALSE) {
return array($record);
}
/* Assertion: $end < strlen($record) */
$first = substr($record, 0, $end);
$rest = substr($record, $end + 1);
}
$fields = split_csv_line($rest);
array_unshift($fields, $first);
return $fields;
}
您的下拉代码是什么??$info_msg=“”$codetype=$_请求['codetype'];如果(!empty($codetype)){$allowed_code=split_csv_line($codetype);那么$allowed_code的输出是什么?var_dump?allowed_code调用split_csv_line。split_csv_line中是我在顶部编写的代码。我要求输出代码(html生成),执行var_dump($allowed_code);并将其发布到那里。
$code_types = array();
$default_search_type = '';
$ctres = sqlStatement("SELECT * FROM code_types WHERE ct_active=1 ORDER BY ct_seq, ct_key");
while ($ctrow = sqlFetchArray($ctres)) {
$code_types[$ctrow['ct_key']] = array(
'active' => $ctrow['ct_active' ],
'id' => $ctrow['ct_id' ],
'fee' => $ctrow['ct_fee' ],
'mod' => $ctrow['ct_mod' ],
'just' => $ctrow['ct_just'],
'rel' => $ctrow['ct_rel' ],
'nofs' => $ctrow['ct_nofs'],
'diag' => $ctrow['ct_diag'],
'mask' => $ctrow['ct_mask'],
'label'=> ( (empty($ctrow['ct_label'])) ? $ctrow['ct_key'] : $ctrow['ct_label'] ),
'external'=> $ctrow['ct_external'],
'claim' => $ctrow['ct_claim'],
'proc' => $ctrow['ct_proc'],
'term' => $ctrow['ct_term'],
'problem'=> $ctrow['ct_problem'],
'drug'=> $ctrow['ct_drug']
);