PHP checkbox多选怎么入数据库和显示出来
<form action="aa_ajax.php?action=survey" method="post" enctype="multipart/form-data" onsubmit="return check_inquiry();">
<input type="hidden" name="id" value="<?php echo $id; ?>" />
<div style="width:80%; margin:0 auto;">
<p>
你是怎么知道我们的?
</p>
<p>
<label style="width:auto;margin-right:15px;"><input type="checkbox" name="knowgla[]" value="1"> 销售联系</label>
<label style="width:auto;margin-right:15px;"><input type="checkbox" name="knowgla[]" value="2"> 搜索引擎搜索</label>
<label style="width:auto;margin-right:15px;"><input type="checkbox" name="knowgla[]" value="3"> 多媒体视频</label>
<label style="width:auto;margin-right:15px;"><input type="checkbox" name="knowgla[]" value="4"> 微博</label>
<label style="width:auto;margin-right:15px;"><input type="checkbox" name="knowgla[]" value="5"> 邮箱</label>
<label style="width:auto;margin-right:15px;"><input type="checkbox" name="knowgla[]" value="6"> 微信群</label>
<label style="width:auto;margin-right:15px;"><input type="checkbox" name="knowgla[]" value="7"> 其他</label>
</p>
<p> </p>
<p>
希望得到我们哪些支持
</p>
<p>
<label style="width:auto;margin-right:15px;"><input type="checkbox" name="interests[]" value="1"> 支持A</label>
<label style="width:auto;margin-right:15px;"><input type="checkbox" name="interests[]" value="2"> 支持B</label>
<label style="width:auto;margin-right:15px;"><input type="checkbox" name="interests[]" value="3"> 支持C</label>
</p>
<p> </p>
<p>对我们满意度打分 </p>
<p>
<label style="width:auto;margin-right:15px;"> <input name="satisfaction1" type="radio" value="1" <?php if ($rsText[satisfaction1]==1){ ?>checked <?php } ?> /> 1</label>
<label style="width:auto;margin-right:15px;"> <input name="satisfaction1" type="radio" value="2" <?php if ($rsText[satisfaction1]==2){ ?>checked <?php } ?> /> 2</label>
<label style="width:auto;margin-right:15px;"> <input name="satisfaction1" type="radio" value="3" <?php if ($rsText[satisfaction1]==3){ ?>checked <?php } ?> /> 3</label>
<label style="width:auto;margin-right:15px;"> <input name="satisfaction1" type="radio" value="4" <?php if ($rsText[satisfaction1]==4){ ?>checked <?php } ?> /> 4</label>
<label style="width:auto;margin-right:15px;"> <input name="satisfaction1" type="radio" value="5" <?php if ($rsText[satisfaction1]==5){ ?>checked <?php } ?> /> 5</label>
</p>
<p> </p>
<div class="clear"></div>
<p class="submit"><input type="submit" value="Submit" class="sub_anniu" /></p>
</div>
</form>
if($action == "survey")
{
$id = check_sql($_POST[id]);
$page = check_sql($_POST[page]);
if($_POST)
{
$data = $_POST;
if(empty($_POST[id])){ ShowMessages('page.php?page='.$data[page].'&id='.$data[id],'有内容为空');}else{
$where[id] = $_POST[id];
$tb = "tb_survey";
$datano = array("id","page");
$sql = ChangeSql($data,$where,$tb,$datano);
if($sql[MessageID]==1){
ShowMessages('page.php?page='.$data[page].'&id='.$data[id],'Successful');
}else
{
ShowMessages('page.php?page='.$data[page].'&id='.$data[id],'含有非法字符6');
}
}
}
}
怎么把knowgla 和 interests多选结果放到数据库knowgla 和 interests字段里,并在页面上选中了就保持为选中的状态;请帮我写出来,谢谢