1.請加入刪除以及編輯的連結,如:<a href='index.php?op=del&sn=$sn'>刪除</a> | <a href='index.php?op=modify&sn=$sn'>編輯</a>
2.$sql="delete from 資料表 where 條件";
1.$dbv='資料庫值';
2.<input type='text' name='xx' value='$dbv'>
1.$checked1=($dbv=='aa')?"checked":"";
2.$checked2=($dbv=='bb')?"checked":"";
3.<input type='radio' name='xx' value='aa' $checked1>
4.<input type='radio' name='xx' value='bb' $checked2>
//回覆單選預設值
function chk($col="",$db=""){
if($col==$db){
return "checked='checked'";
}else{
return "";
}
}
1.<input type='radio' name='xx' value='aa' ".chk("aa",$dbv).">
2.<input type='radio' name='xx' value='bb' ".chk("bb",$dbv).">
//回覆複選預設值
function chk2($col="",$db_arr=""){
if(in_array($col,$db_arr)){
return "checked='checked'";
}else{
return "";
}
}
1.$dbv_arr=explode(",",$dbv);
2.<input type='checkbox' name='xx' value='aa' ".chk2("aa",$dbv_arr).">
3.<input type='checkbox' name='xx' value='bb' ".chk2("bb",$dbv_arr).">
1.<textarea name='xx'>$dbv</textarea>
1.include "city_menu/city.php";
2.$default_city_key=default_city($city);
3.$default_town_key=default_town($city,$town);
4.修改:
(1) form.city.selectedIndex = $default_city_key;
(2) form.town.selectedIndex = $default_town_key;
1.$sql="update `資料表` set `欄1`='值1' , `欄2`='值2' where 條件";