调查问卷数据提交问题
一个有10道题的调查问卷,怎么将答好的这10道题的调查问卷,一点击提交按钮后,让它全都插入到数据库中去啊,请高人指点???代码如下:
<?php
require(dirname(__FILE__)."/../include/common.inc.php");
require(DEDEINC."/dedevote.class.php");
$link = @mysql_connect('localhost','root','') or die('Could not connect: ' . mysql_error());
$selected = @mysql_select_db("xmucms",$link);
mysql_query("SET NAMES UTF8");
$result = @mysql_query("SELECT * FROM `dede_vote` ORDER BY aid ASC",$link);
echo "<tr><td style='color:#3F7652'>厦门大学在线调查问卷</td></tr>";
echo "<form name='voteform' method='post'; action='vote_submit.php' target='_blank'>";
while ($myrow = @mysql_fetch_array($result)) {
echo "<strong>{$myrow[1]}</strong><br/>";
if($myrow[5]==1){
$str2=preg_replace("|\<v\:note id\='(.*)' count\='\d'>(.*)</v:note>|i","<input type='checkbox' name='vot{$myrow[0]}[]' value='$1' />$2",$myrow[10]);
}else{
$str2=preg_replace("|\<v\:note id\='(.*)' count\='\d'>(.*)</v:note>|i","<input type='radio' name='vot{$myrow[0]}' value='$1' />$2",$myrow[10]);
}
// var_dump($myrow[10]);
// var_dump($str2);
echo $str2;
echo "<br/><br/>";
}
echo "最后请留下投票人的信息(如:姓名,家庭住址,联系电话,职业等)";
echo "及对本网站及服务的综合意见和建议<textarea rows='3' cols='30'>这是我的测试页面</textarea>(500字之内)";
echo '<br>';
echo "<input type='submit' class='btn-1' name='vbt1' value='提交' \/>";
echo "\n";
echo "<input type='button' class='btn-1' name='vbt2' value='查看结果'";
echo "onClick=window.open('\/plus\/vote.php?dopost=view&aid=1')";
echo '<script language="javascript" src="http://www.dede1.com//data/vote/vote_2.js"></script>';
echo "</form> ";
?>
------解决方案--------------------
批量UPDATE执行,可以使用存储过程