我正在尝试将字段中的值插入数据库,我有10个字段,其中5个是动态的
当我在字段中插入值时,只有添加到数据库但动态的静态值
我正在使用Dreamweaver为学校做这个项目
插入查询
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$sRoom = $_POST['sRoom'];
$sDay = $_POST['sDay'];
$sStartTime = $_POST['sStartTime'];
$sLateTime = $_POST['sLateTime'];
$sEndTime = $_POST['sEndTime'];
for($i=0;$i<count($sDay);$i++){
$insertSQL = sprintf("INSERT INTO `section` (sNumber, sStartTime, sLateTime, sEndTime, sRoom, sInstructor, sCourseCode, sStartDate, sEndDate, `day`) VALUES (%s, '$sStartTime[i]', '$sLateTime[i]', '$sEndTime[i]', '$sRoom[i]', %s, %s, %s, %s, '$sDay[i]')",
GetSQLValueString($_POST['sNumber'], "int"),
GetSQLValueString($_POST['sInstractor'], "text"),
GetSQLValueString($_POST['sCourse'], "text"),
GetSQLValueString($_POST['date'], "date"),
GetSQLValueString($_POST['date2'], "date"));
mysql_select_db($database_dbc, $dbc);
$Result1 = mysql_query($insertSQL, $dbc) or die(mysql_error());}}