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>';


文章標籤
全站熱搜
創作者介紹
創作者 incode 的頭像
incode

程式筆記本

incode 發表在 痞客邦 留言(0) 人氣(0)