$sql = "SELECT `cid`, `sname` From `tr_company`";
$result = mysql_query($sql) or trigger_error(mysql_error());
$select_c = '<select name="cid">';
while($company = mysql_fetch_array($result)){
$tag = $company['sname'];
$value = $company['cid'];
$select_c .= "<option value=\"$value\" ";
if ($value == $row['cid']){
$select_c .= 'selected="selected"';
}
$select_c .= ">$tag</option>";
}
$select_c .= '</select>';
全站熱搜
留言列表