php 批量插入字段

foreach ($_POST as $key => $value){
    $array[] = "add ".$key." varchar(220),";
}

$string=rtrim(implode(" ",$array), ",");

$sql="alter table fengxianxiangmu.weize_fengxian_qysb ".$string."";

echo $sql;

 

posted @ 2015-12-04 16:52  fleam  阅读(350)  评论(0编辑  收藏  举报