PHP5 - PHP/MySQL Insert Into not working right!!!
What I have is a series of drop down menus in which the user selects a value. For some reason these values are not making into the database and if they do, it often shows a value different than what the user chose.
Here is my code from one of the sections, there are actually 10 of these sections as there are 10 courses. **The other fields in my DB that are NOT drop down menus insert fine.
What could be wrong here? I am using Dreamweaver CS5 and the INSERT RECORD server behavior.
Any help is GREATLY appreciated!
The Form Code:
<form action="<?php echo $editFormAction; ?>" id="cMapInputForm" name="cMapInputForm" enctype="multipart/data-form"
method="POST" >
The Drop Down Menus HTML Code
<label for="c2_lo1_OS"></label>
<select name="c1_lo1_OS" id="c1_lo1_OS">
<option value="0" selected="selected">0</option>
<option value="1">M</option>
<option value="2">X</option>
</select></td>
<td width="46" align="center" valign="middle" bgcolor="#E0F8E0"><label for="c2_lo1_Level"></label>
<select name="c1_lo1_Level" id="c1_lo1_Level">
<option value="0" selected="selected">0</option>
<option value="1">I</option>
<option value="2">E</option>
<option value="3">R</option>
<option value="4">A</option>
</select></td>
<td width="53" align="center" valign="middle" bgcolor="#E0F8E0"><label for="c2_lo1_feedback"></label>
<select name="c1_lo1_feedback" id="c1_lo1_feedback">
<option value="0" selected="selected">0</option>
<option value="1">F</option>
</select></td>
The PHP Code:
if ((isset($POST["MM_insert"])) && ($POST["MM_insert"] == "cMapInputForm")) {
$insertSQL = sprintf("INSERT INTO course1_os_level_feedback (course1_Name, c1_lo1_OS, c1_lo1_Level, c1_lo1_Feedback, c1_lo2_OS, c1_lo2_Level, c1_lo2_Feedback, c1_lo3_OS, c1_lo3_Level, c1_lo3_Feedback, c1_lo4_OS, c1_lo4_Level, c1_lo4_Feedback, c1_lo5_OS, c1_lo5_Level, c1_lo5_Feedback, c1_lo6_OS, c1_lo6_Level, c1_lo6_Feedback, c1_lo7_OS, c1_lo7_Level, c1_lo7_Feedback) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($POST['Course1_Name'], "text"),
GetSQLValueString($POST['c1_lo1_OS'], "text"),
GetSQLValueString($POST['c1_lo1_Level'], "text"),
GetSQLValueString($POST['c1_lo1_feedback'], "text"),
GetSQLValueString($POST['c1_lo2_OS'], "text"),
GetSQLValueString($POST['c1_lo2_Level'], "text"),
GetSQLValueString($POST['c1_lo2_feedback'], "text"),
GetSQLValueString($POST['c1_lo3_OS'], "text"),
GetSQLValueString($POST['c1_lo3_Level'], "text"),
GetSQLValueString($POST['c1_lo3_feedback'], "text"),
GetSQLValueString($POST['c1_lo4_OS'], "text"),
GetSQLValueString($POST['c1_lo4_Level'], "text"),
GetSQLValueString($POST['c1_lo4_feedback'], "text"),
GetSQLValueString($POST['c1_lo5_OS'], "text"),
GetSQLValueString($POST['c1_lo5_Level'], "text"),
GetSQLValueString($POST['c1_lo5_feedback'], "text"),
GetSQLValueString($POST['c1_lo6_OS'], "text"),
GetSQLValueString($POST['c1_lo6_Level'], "text"),
GetSQLValueString($POST['c1_lo6_feedback'], "text"),
GetSQLValueString($POST['c1_lo7_OS'], "text"),
GetSQLValueString($POST['c1_lo7_Level'], "text"),
GetSQLValueString($POST['c1_lo7_feedback'], "text"));
mysql_select_db($database_curriculumPathways, $curriculumPathways);
$Result1 = mysql_query($insertSQL, $curriculumPathways) or die(mysql_error());
My Submit Button Code:
<input type="submit" name="submit" id="submit" value="Submit all to Database" />
<input type="hidden" name="MM_insert" value="cMapInputForm" />